-
Notifications
You must be signed in to change notification settings - Fork 0
Function: get remaining block count
theblackswitch edited this page May 15, 2026
·
1 revision
#mtb-generated:<namespace>/<multiblock_id>/get_remaining_block_count {block:<block_id>}
This function gets the number of missing blocks in the multiblock for a specifc block ID.
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
block_id: string | The id of the block you want to track (For example: minecraft:stone)
block count: The amount of blocks of the type specified, that are missing.
# Generate a checklist for the multiblock (run as the multiblock root)
# This example does it for stone only
execute store result score #block_count temp run function #mtb-generated:tech_datapack/industrial_furnace/get_block_count {block:"minecraft:stone"}
execute store result score #remaining temp run function #mtb-generated:tech_datapack/industrial_furnace/get_remaining_block_count {block:"minecraft:stone"}
scoreboard players operation #total temp = #block_count temp
scoreboard players operation #total temp += #remaining temp
title @a[distance=..20] actionbar [{text:"Remaining: ",color:"gold"},{object:"atlas",sprite:"minecraft:block/stone"},{text:" minecraft:stone ",color:green"},{objective:"temp",name:"#remaining",color:"red"},{text:"/", color:"gray"},{objective:"temp",name:"#total",color:"gray"}]wiki written by ~theblackswitch