Skip to content

Function: get rotation

theblackswitch edited this page May 15, 2026 · 3 revisions

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

This function is used to get the current rotation state of the multiblock.

Context:

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

Note

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

Return:

The rotation of the multiblock instance. One of: 0, 90, 180, 270

Example:

# Reset the rotation of the multiblock back to 0 (run as the multiblock root)

execute store result score #rotation temp run function #mtb-generated:tech_datapack/industrial_furnace/get_rotation

execute if score #rotation temp matches 0 run return 0
execute if score #rotation temp matches 90 run return run function #mtb-generated:tech_datapack/industrial_furnace/rotate/clockwise
execute if score #rotation temp matches 270 run return run function #mtb-generated:tech_datapack/industrial_furnace/rotate/counter_clockwise

execute if score #rotation temp matches 180 run function #mtb-generated:tech_datapack/industrial_furnace/rotate/clockwise
execute if score #rotation temp matches 180 run function #mtb-generated:tech_datapack/industrial_furnace/rotate/clockwise

Clone this wiki locally