Skip to main content

Replace Craftengine Block

Replace the block or furniture at a location with another one

Fields

FieldTypeDefaultDescription
locationVar<Position>ORIGINThe location to replace. Bind it to the position of the triggering event. The yaw is used to orient furniture.With rotation
replaceWithCraftEngineBlockReplacementCUSTOM_BLOCKWhat the location should be replaced with.Values:CUSTOM_BLOCKFURNITUREVANILLA_BLOCKAIR
blockIdVar<String>—The CraftEngine block ID to place (e.g., 'namespace:block_id'). Only used for custom blocks.
furnitureIdVar<String>—The CraftEngine furniture ID to place (e.g., 'namespace:furniture_id'). Only used for furniture.
materialMaterialSTONEThe vanilla material to place. Only used for vanilla blocks.
playSoundBooleantrueWhether to play the placement sound of the new block or furniture. World replacements only.
audienceCraftEngineReplaceAudienceAUTOWho sees the change. Auto: only the player (or their zone's group) inside a quest zone, everyone outside.Values:AUTOWORLDQUEST_ZONE
zoneIdString—The quest zone to file a per-player change under, as named on its audience. Only needed where zones overlap.
Common TypeWriter fields (criteria, modifiers, triggers)
FieldTypeDefaultDescription
criteriaList<Criteria>empty—
modifiersList<Modifier>empty—
triggersList<Ref<TriggerableEntry>>empty—

How to use it​

Swaps whatever is at location for a custom block, a piece of furniture, a vanilla block or air. Anything already there is removed through CraftEngine first, so every combination works (block to furniture, furniture to vanilla block, and so on). Bind location to the position of an interact event, for example to turn a lever-like block into its activated variant.

audience decides who sees it:

ValueBehaviour
AUTOInside a quest zone, only the player or their group sees it. Outside every zone, the world is changed.
WORLDThe world is always changed.
QUEST_ZONEOnly the player or their group. Nothing happens outside a zone.

The zone, artifact and group are read from where the player stands. zoneId is only needed where zones overlap: a player in several zones with no zoneId gets nothing and a line in the log. playSound only applies to world replacements. The replacement runs one tick after the trigger.