Replace Craftengine Block
Replace the block or furniture at a location with another one
Fields
| Field | Type | Default | Description |
|---|---|---|---|
location | Var<Position> | ORIGIN | The location to replace. Bind it to the position of the triggering event. The yaw is used to orient furniture.With rotation |
replaceWith | CraftEngineBlockReplacement | CUSTOM_BLOCK | What the location should be replaced with.Values:CUSTOM_BLOCKFURNITUREVANILLA_BLOCKAIR |
blockId | Var<String> | — | The CraftEngine block ID to place (e.g., 'namespace:block_id'). Only used for custom blocks. |
furnitureId | Var<String> | — | The CraftEngine furniture ID to place (e.g., 'namespace:furniture_id'). Only used for furniture. |
material | Material | STONE | The vanilla material to place. Only used for vanilla blocks. |
playSound | Boolean | true | Whether to play the placement sound of the new block or furniture. World replacements only. |
audience | CraftEngineReplaceAudience | AUTO | Who sees the change. Auto: only the player (or their zone's group) inside a quest zone, everyone outside.Values:AUTOWORLDQUEST_ZONE |
zoneId | String | — | 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)
| Field | Type | Default | Description |
|---|---|---|---|
criteria | List<Criteria> | empty | — |
modifiers | List<Modifier> | empty | — |
triggers | List<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:
| Value | Behaviour |
|---|---|
AUTO | Inside a quest zone, only the player or their group sees it. Outside every zone, the world is changed. |
WORLD | The world is always changed. |
QUEST_ZONE | Only 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.