Skip to content

Function: move

theblackswitch edited this page May 15, 2026 · 2 revisions

#mtb-generated:<namespace>/<multiblock_id>/move/incr_x
#mtb-generated:<namespace>/<multiblock_id>/move/incr_y
#mtb-generated:<namespace>/<multiblock_id>/move/incr_z
#mtb-generated:<namespace>/<multiblock_id>/move/decr_x
#mtb-generated:<namespace>/<multiblock_id>/move/decr_y
#mtb-generated:<namespace>/<multiblock_id>/move/decr_z

These function are used to move the whole multiblock in a certain direction. incr increments on a certain axis and decr decrements on a certain axis.

Context:

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

Note

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

Example:

# Nudge the multiblock when the player clicks with an item in the right menu. Sneaking will invert the axis.

# 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 5 if score @s schematic.click matches 1.. unless predicate tech_datapack:sneak 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/incr_x
execute if score @s schematic.menu matches 6 if score @s schematic.click matches 1.. unless predicate tech_datapack:sneak 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/incr_y
execute if score @s schematic.menu matches 7 if score @s schematic.click matches 1.. unless predicate tech_datapack:sneak 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/incr_z

execute if score @s schematic.menu matches 5 if score @s schematic.click matches 1.. if predicate tech_datapack:sneak 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/decr_x
execute if score @s schematic.menu matches 6 if score @s schematic.click matches 1.. if predicate tech_datapack:sneak 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/decr_y
execute if score @s schematic.menu matches 7 if score @s schematic.click matches 1.. if predicate tech_datapack:sneak 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/decr_z

Clone this wiki locally