replace_craftengine_block
Replace Block - Action entry.
Replaces the block or furniture at a location with another one.
Entry Information
| Property | Value |
|---|---|
| Entry ID | replace_craftengine_block |
| Type | Action |
Fields
| Field | Description |
|---|---|
| Location | The location to replace. Bind it to the position of the triggering event. The yaw orients placed furniture. |
| Replace With | What the location becomes: CUSTOM_BLOCK, FURNITURE, VANILLA_BLOCK or AIR. |
| Block Id | The CraftEngine block ID to place (namespace:block_id). Only used for custom blocks. |
| Furniture Id | The CraftEngine furniture ID to place (namespace:furniture_id). Only used for furniture. |
| Material | The vanilla material to place. Only used for vanilla blocks. |
| Play Sound | Whether to play the placement sound of the new block or furniture. |
Behaviour
Any CraftEngine custom block or furniture already present is removed through the CraftEngine API first, so the engine drops its own data instead of leaving a ghost state behind. That makes every combination valid: block to furniture, furniture to vanilla block, furniture to furniture, and so on.
The replacement is applied one tick after the trigger, so the write lands outside the interaction that caused it.
How could this be used?
Combine it with on_craftengine_block_interact_event or on_craftengine_furniture_interact_event
and bind the location to the event's position: right-clicking a lever-like custom block can turn it
into its "activated" variant, an empty chair can be swapped for an occupied one, a crop can be reset
to its first growth stage, or a puzzle block can be cleared away once solved.
Usage
Add this entry from the Typewriter editor and fill in its fields. Every field carries an inline description in the editor.