Skip to main content

Craftengine Quest Zone Audience

Keep a player's own block, furniture and item state for a quest zone

Fields

FieldTypeDefaultDescription
artifactRef<QuestStateArtifactEntry>—Where this zone's state is stored. Zones sharing an artifact are cleared together.
zoneIdString—Name this zone's state is filed under. Leave empty to use this entry's own id.
groupRef<GroupEntry>—Share what is seen across this group. Leave empty for every player to have their own view.
trackBlocksBooleantrueRecord the blocks and furniture the player breaks and places inside the zone.
giveVanillaDropsBooleanfalseVanilla drops when a tracked block is broken. CraftEngine items are not vanilla drops — grant those from the break event instead.
inventoryModeQuestInventoryModeNONEWhat the zone does with the player's inventory.
capturedItemsList<String>emptyItems taken out of the inventory, as CraftEngine ids or vanilla materials. Filtered mode only.
refreshIntervalInt20How often, in ticks, the player's view is re-sent. A reloaded chunk serves the real world back.
refreshRadiusInt48How 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.

FieldWhat to know
artifactThe Quest State Artifact where the state is kept. Zones sharing an artifact are cleared together.
zoneIdThe filing name. Empty uses this entry's id. Actions that write to the zone must use the same name.
groupShare 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.
trackBlocksRecord breaks and placements. Furniture a player places becomes a ghost for them, furniture they break is hidden from them.
giveVanillaDropsGive the vanilla drops of a tracked block. CraftEngine items are not vanilla drops: give those from a break event.
inventoryModeNONE leaves the inventory alone. FILTERED takes only capturedItems. FULL_SWAP exchanges the whole inventory at the border.
capturedItemsUsed 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 trackBlocks on, 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.