Craftengine Quest Zone Audience
Keep a player's own block, furniture and item state for a quest zone
Fields
| Field | Type | Default | Description |
|---|---|---|---|
artifact | Ref<QuestStateArtifactEntry> | — | Where this zone's state is stored. Zones sharing an artifact are cleared together. |
zoneId | String | — | Name this zone's state is filed under. Leave empty to use this entry's own id. |
group | Ref<GroupEntry> | — | Share what is seen across this group. Leave empty for every player to have their own view. |
trackBlocks | Boolean | true | Record the blocks and furniture the player breaks and places inside the zone. |
giveVanillaDrops | Boolean | false | Vanilla drops when a tracked block is broken. CraftEngine items are not vanilla drops — grant those from the break event instead. |
inventoryMode | QuestInventoryMode | NONE | What the zone does with the player's inventory. |
capturedItems | List<String> | empty | Items taken out of the inventory, as CraftEngine ids or vanilla materials. Filtered mode only. |
refreshInterval | Int | 20 | How often, in ticks, the player's view is re-sent. A reloaded chunk serves the real world back. |
refreshRadius | Int | 48 | How far, in blocks, the view is re-sent around the player. |
How to use it
Nest this audience under whatever already decides who is in the zone (an area audience, a quest state, a dimension). Being added to it restores the player's own view; being removed puts the world back as the builder left it. In between, blocks and furniture the player breaks or places are recorded for them alone.
| Field | What to know |
|---|---|
artifact | The Quest State Artifact where the state is kept. Zones sharing an artifact are cleared together. |
zoneId | The filing name. Empty uses this entry's id. Actions that write to the zone must use the same name. |
group | Share one view across a group. Empty gives every player their own view, and so does a player who belongs to none of the group's groups. The group is read when the player enters. |
trackBlocks | Record breaks and placements. Furniture a player places becomes a ghost for them, furniture they break is hidden from them. |
giveVanillaDrops | Give the vanilla drops of a tracked block. CraftEngine items are not vanilla drops: give those from a break event. |
inventoryMode | NONE leaves the inventory alone. FILTERED takes only capturedItems. FULL_SWAP exchanges the whole inventory at the border. |
capturedItems | Used by FILTERED. Each entry is read as a CraftEngine item id first, then as a vanilla material (mynamespace:quest_lantern, torch). |
Inventory modes
With FULL_SWAP, entering sets the player's own inventory aside and hands them the inventory they left the zone with (empty the first time). Leaving does the reverse, slot for slot. Neither inventory is ever overwritten by the other. A player who disconnects inside the zone keeps the zone inventory and gets the right one at the exit. Inventories are never shared inside a group.
Which actions belong in a zone
Only Set Quest Block, Set Quest Furniture, Clear Quest State and Replace Block on AUTO or QUEST_ZONE write a per-player view. The Place and Remove actions write the world, which everyone sees.
Actions that write from outside the audience must name the same artifact, zoneId and group as this audience. A grouped zone files its state under the group, so an action without the group writes where nothing reads.
Pitfalls
- A block a player placed cannot be dug again by that player, because the world holds air there. Take it back with Set Quest Block.
- With
trackBlockson, block and furniture break and place events do not fire for what the zone records. Use the interact events to advance a quest. - Collision follows the world. Ghost furniture stops nobody; a hidden world furniture still stops the player who cannot see it.
- A protection plugin that cancels a break first wins: a refused break is never recorded.