Skip to content

Function: is outline visible

theblackswitch edited this page May 15, 2026 · 2 revisions

#mtb-generated:<namespace>/<multiblock_id>/outline/is_visible

This function is used to check whether the multiblock is currently showing it's outline.

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:

visible: 1 when outline is visible, else fail

Example:

# Play a sound when the player toggles the outline of this multiblock (run as the multiblock root)

execute store success score #outline temp run function #mtb-generated:tech_datapack/industrial_furnace/outline/is_visible

execute if entity @s[tag=td.outline] if score #outline temp matches 0 run playsound minecrraft:entity.armadillo.brush master @a ~ ~ ~ 1 0.9
execute if entity @s[tag=!td.outline] if score #outline temp matches 1 run playsound minecrraft:entity.armadillo.brush master @a ~ ~ ~ 1 1.2

execute if #outline temp matches 1 run tag @s add td.outline
execute if #outline temp matches 0 run tag @s remove td.outline

Clone this wiki locally