Skip to content

Function: set position

theblackswitch edited this page May 15, 2026 · 4 revisions

#mtb-generated:<namespace>/<multiblock_id>/move/set_pos

This function is used to move the whole multiblock to the current position.

Context:

This function needs to run as the root of the multiblock instance that you want to edit. It also needs to run at the new position for the multiblock.

Note

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

Example:

# Reposition the multiblock when the player clicks with a new schematic item, in the right menu

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

execute if score @s schematic.menu matches 2 if score @s schematic.click matches 1.. as @e[type=minecraft:block_display,tag=tech_datapack-industrial_furnace,tag=mtb.root,tag=td.currently_placing,predicate=tech_datapack:match_player_id] run function #mtb-generated:tech_datapack/industrial_furnace/move/set_pos

Clone this wiki locally