You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function is used to get the amount of blocks that need to be correct for the multiblock to complete.
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:
block count: The amount of blocks in the structure.
Example:
# Calculate the progress of the multiblock in a percentage and show it in the action bar (run as the multiblock root)scoreboardplayersset#100temp100executestoreresultscore#block_counttemprunfunction#mtb-generated:tech_datapack/industrial_furnace/get_total_block_countexecutestoreresultscore#progresstemprunfunction#mtb-generated:tech_datapack/industrial_furnace/progressscoreboardplayersoperation#progresstemp*=#100tempscoreboardplayersoperation#progresstemp/=#block_counttemptitle@a[distance=..20]actionbar[{text:"Industrial furnace progress: ",color:"gold"},{objective:"temp",name:"#progress"},{text:"%"}]