Skip to content

Function: remove instance

theblackswitch edited this page May 8, 2026 · 3 revisions

#mtb-generated:<namespace>/<multiblock_id>/remove_instance

This function is used to remove the entire multiblock. This includes all displays that show the blueprint or block displays that make up the border

Context:

This function needs to run as the root marker of the multiblock instance that you want to remove.

Note

You can use the selector @e[type=minecraft:marker,tag=<namespace>-<multiblock_id>,tag=mtb.root] to find the root marker

Example:

# Remove the multiblock when unequips a custom goggles item

# The implementing datapack uses a custom player ID system to link the multiblock with the player
scoreboard players operation #search tbs.ID = @s tbs.ID

execute unless items entity @s armor.head *[minecraft:custom_data~{"goggles":true}] as @e[type=minecraft:marker,tag=tech_datapack-industrial_furnace,tag=mtb.root,predicate=tech_datapack:match_player_id] run function #mtb-generated:tech_datapack/industrial_furnace/remove_instance

Clone this wiki locally