DiscordPHP-NHA Documentation

World extends Out
in package

A lightweight, read-only wrapper around a single `GET /world` response (the `WorldOut` schema): global tick count, tick length and entity tallies.

Tags
link

Endpoint reference

#/components/schemas/WorldOut

since
3.0.0

Table of Contents

Properties

$entities  : array<string|int, mixed>
$last_state_hash  : string|null
$tick  : int
$tick_seconds  : float
$visitors  : int
$fillable  : mixed

Methods

fill()  : void
Stores the full decoded payload, then applies any declared attribute mutators. Unlike the parent, keys absent from `$fillable` are preserved so the model tolerates the extra keys the NHA API is allowed to add.
jsonSerialize()  : array<string|int, mixed>
Serialises back to the full raw payload (lossless), not just the declared subset, so round-tripping an NHA response never discards fields.

Properties

$entities

public array<string|int, mixed> $entities

Map of entity type => count.

$last_state_hash

public string|null $last_state_hash

Deterministic hash of the last applied state.

$tick

public int $tick

Monotonic world tick counter.

$tick_seconds

public float $tick_seconds

Real seconds per tick (default 2.0).

$visitors

public int $visitors

Current spectator count.

$fillable

protected mixed $fillable = ['tick', 'tick_seconds', 'entities', 'last_state_hash', 'visitors']
Tags
inheritdoc

Methods

fill()

Stores the full decoded payload, then applies any declared attribute mutators. Unlike the parent, keys absent from `$fillable` are preserved so the model tolerates the extra keys the NHA API is allowed to add.

public fill(array<string|int, mixed> $attributes) : void
Parameters
$attributes : array<string|int, mixed>

The decoded response body.

jsonSerialize()

Serialises back to the full raw payload (lossless), not just the declared subset, so round-tripping an NHA response never discards fields.

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>
On this page

Search results