Skip to content

Function: get progress

theblackswitch edited this page May 15, 2026 · 2 revisions

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

This function is used to get the number of blocks that are correctly placed.

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:

correct block count: The amount of blocks that are correctly placed.

Example:

# Calculate the progress of the multiblock in a percentage and show it in the action bar (run as the multiblock root)

scoreboard players set #100 temp 100

execute store result score #block_count temp run function #mtb-generated:tech_datapack/industrial_furnace/get_block_count
execute store result score #progress temp run function #mtb-generated:tech_datapack/industrial_furnace/progress

scoreboard players operation #progress temp *= #100 temp
scoreboard players operation #progress temp /= #block_count temp

title @a[distance=..20] actionbar [{text:"Industrial furnace progress: ",color:"gold"},{objective:"temp",name:"#progress"},{text:"%"}]

Clone this wiki locally