world_state
Retrieve a current world snapshot, including player position, health, and held items, within a given radius to avoid round-trip queries.
Instructions
What the world looks like right now.
With NO class_name this costs nothing and waits for nothing: the mod republishes the player's position, health and what is in their hands every tick, so the answer is already on disk. That is deliberate -- a snapshot a caller has to pay a full command round trip for (a second to be claimed, two more of terminal dwell) would make the cheapest question the most expensive one.
With a class_name it also sends a query command to count objects of that
class within radius, because a count needs arguments only a command
carries. The count comes back in world.query_count as well as in the
detail, so it stays readable on later snapshots too -- which is how "is the
item I spawned a minute ago still there?" gets answered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pos | No | ||
| radius | No | ||
| timeout | No | ||
| class_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| hint | No | ||
| error | No |