Skip to content

Function: set rotation

theblackswitch edited this page May 15, 2026 · 1 revision

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

This function is used to set the rotation of the whole multiblock to an exact value.

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:

# Make the multiblock rotate towards the player when they're placing the multiblock (runs as the multiblock root)
execute if score #rot.target temp matches 0 run function #mtb-generated:custom_block/steam_engine/rotate/set_rotation {rotation:0}
execute if score #rot.target temp matches 90 run function #mtb-generated:custom_block/steam_engine/rotate/set_rotation {rotation:90}
execute if score #rot.target temp matches 180 run function #mtb-generated:custom_block/steam_engine/rotate/set_rotation {rotation:180}
execute if score #rot.target temp matches 270 run function #mtb-generated:custom_block/steam_engine/rotate/set_rotation {rotation:270}
function #mtb-generated:custom_block/steam_engine/move/set_pos

function #mtb-generated:custom_block/steam_engine/outline/show {args:{}}

Clone this wiki locally