Pular para o conteúdo principal

craftengine_quest_zone_audience

Type: misc entry Exact entry ID: craftengine_quest_zone_audience

Role

This TypeWriter entry is registered in code with the exact display name Keep a player's own block, furniture and item state for a quest zone.

It gives every player their own version of a zone. Nest it under whatever already decides who is inside — an area audience, a quest state, a dimension. Being added to it restores that player's own view of the zone; being removed puts the world back exactly as the builder left it. Between the two, the blocks and furniture they break or place inside the zone are recorded for them alone and shown to nobody else.

The world is never modified. A deviation is a block sent to one player on top of the real one, a piece of the world's furniture hidden from one player, or a ghost — a piece of furniture that exists for one player only. That is what makes the zone reset free: leaving does not roll anything back, it simply stops sending the deviation. Nothing is left half applied if the server stops mid quest, and two players can stand in the same room without seeing each other's progress.

Sharing a room. Set group and the zone files its state under the player's group instead: every member sees the same blocks and the same furniture, and what one of them breaks or places is shown to all of them at once. Inventories are never shared. Without a group — the default — every player has the zone to themselves, and so does a player who belongs to none of the group's groups. Which group a player is in is read when they enter the zone.

Verified fields

Exact fieldTypeField guidance
artifactRef<QuestStateArtifactEntry>Where this zone's state is stored. Zones sharing an artifact are cleared together.
zoneIdStringName 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.
trackBlocksBooleanRecord the blocks and furniture the player breaks and places inside the zone.
giveVanillaDropsBooleanVanilla drops when a tracked block is broken. CraftEngine items are not vanilla drops — grant those from the break event instead.
inventoryModeQuestInventoryModeWhat the zone does with the player's inventory.
capturedItemsList<String>Items taken out of the inventory, as CraftEngine ids or vanilla materials. Filtered mode only.
refreshIntervalIntHow often, in ticks, the player's view is re-sent. A reloaded chunk serves the real world back.
refreshRadiusIntHow far, in blocks, the view is re-sent around the player.

inventoryMode values

ValueBehaviour
NONEThe inventory is left alone. Only blocks are tracked.
FILTEREDOnly the items listed in capturedItems are taken out on the way out and handed back on the way in. The rest of the inventory is never touched.
FULL_SWAPThe whole inventory is set aside and given back slot for slot, exactly as it was.

A capturedItems entry is read as a CraftEngine item id first and as a vanilla material second, so both mynamespace:quest_lantern and torch work without saying which is which.

In practice

Create a craftengine_quest_state_artifact first, then point one or more zones at it. Zones that share an artifact are cleared together by a single craftengine_clear_quest_state, so give a quest chapter one artifact and a standalone puzzle room its own.

Leave zoneId empty unless two zones must share the same filing name on purpose.

For a CraftEngine block, prefer craftengine_set_quest_block over letting the player break it: the action resolves the id through CraftEngine, so the player is shown the real custom block instead of the vanilla state hiding underneath it. The same action raises a piece of furniture for one player; craftengine_set_quest_furniture hides one of the world's.

With trackBlocks on, a piece of furniture a player places by hand becomes a ghost for them (and their group), and one they break is hidden from them — the world keeps it. The on_craftengine_furniture_place_event and on_craftengine_furniture_break_event triggers do not fire for these, exactly as the block events do not fire for a tracked block: the zone has taken the action over. Use the interact event, or craftengine_set_quest_block from a trigger, to advance a quest.

Actions that write a deviation from outside the audience — set quest block, set quest furniture, clear — must name the same artifact, zoneId and group as the audience. A grouped zone files its state under the group; an action without the group writes where nothing reads.

Common issue

If craftengine_quest_zone_audience is not available, check the installed extension version, the selected TypeWriter category, the exact identifier, and the extension dependencies. An entry from a Soon extension must not be used as an available feature.

A block a player placed cannot be broken again by that player. The world holds air at that position, so the client's dig never reaches the server as anything actionable. Raise a block with craftengine_set_quest_block and take it back the same way rather than expecting the player to mine it.

Player movement follows the client, not the world. Walking through a block one has broken works, and standing on a block one has placed works, because the server does not re-check block collisions for player movement. Two things the server does compute are handled by the extension: suffocation inside a block only this player sees through is cancelled, and an interaction aimed at such a block is denied, so a broken seal no longer opens the chest behind it. A server-side anticheat that simulates collisions itself is outside what an extension can decide.

Deviations are re-sent on a cadence. A client that reloads a chunk is served the real world again. Lower refreshInterval if a deviation flickers back after a long walk; raise it if a very large zone costs too much. Ghost furniture is recreated on the same cadence when its chunk was unloaded and reloaded — a ghost is never recovered from the world, only from the quest state.

Two players at the same block. A placement cancelled by the zone is still written and reverted in the world, and both writes reach every player nearby. Anyone shown something else at that block is sent their deviation again immediately; if it still flickers, the second write beat the re-send and the cadence catches it.

A ghost stops nobody. Its viewers walk through it, as does everyone else — the alternative, an invisible wall for the players who cannot see it, reads as a bug. A hidden piece of the world's furniture, on the other hand, keeps its collision for the player who cannot see it.

Technical reference

Source moduleSource file
TypeWriter-CraftEngineExtensionqueststate/QuestZoneAudienceEntry.kt
TypeWriter-CraftEngineExtensionqueststate/QuestBlockConsistency.kt
TypeWriter-CraftEngineExtensionqueststate/QuestFurnitureGhosts.kt