Files
BlockAction
Code
13 243
BlockAction/data/blockaction/function/decompressor/check.mcfunction
# Store main hand item count
execute store result score @s count run data get entity @s SelectedItem.count
# --- Iron Block 1x → Iron Ingot 9x ---
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:iron_block run particle minecraft:dust{color:[0.8,0.8,0.8],scale:1.5} ~ ~1 ~ 0.3 0.5 0.3 0.1 15
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:iron_block run playsound minecraft:block.anvil.break block @a ~ ~ ~ 1 1.5
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:iron_block run clear @s minecraft:iron_block 1
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:iron_block run give @s minecraft:iron_ingot 9
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:iron_block run advancement revoke @s only blockaction:interact/decompressor
# --- Gold Block 1x → Gold Ingot 9x ---
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:gold_block run particle minecraft:dust{color:[1.0,0.85,0.0],scale:1.5} ~ ~1 ~ 0.3 0.5 0.3 0.1 15
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:gold_block run playsound minecraft:block.anvil.break block @a ~ ~ ~ 1 1.5
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:gold_block run clear @s minecraft:gold_block 1
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:gold_block run give @s minecraft:gold_ingot 9
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:gold_block run advancement revoke @s only blockaction:interact/decompressor
# --- Diamond Block 1x → Diamond 9x ---
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:diamond_block run particle minecraft:dust{color:[0.5,0.9,1.0],scale:1.5} ~ ~1 ~ 0.3 0.5 0.3 0.1 15
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:diamond_block run playsound minecraft:block.anvil.break block @a ~ ~ ~ 1 1.5
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:diamond_block run clear @s minecraft:diamond_block 1
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:diamond_block run give @s minecraft:diamond 9
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:diamond_block run advancement revoke @s only blockaction:interact/decompressor
# --- Emerald Block 1x → Emerald 9x ---
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:emerald_block run particle minecraft:dust{color:[0.2,1.0,0.2],scale:1.5} ~ ~1 ~ 0.3 0.5 0.3 0.1 15
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:emerald_block run playsound minecraft:block.anvil.break block @a ~ ~ ~ 1 1.5
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:emerald_block run clear @s minecraft:emerald_block 1
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:emerald_block run give @s minecraft:emerald 9
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:emerald_block run advancement revoke @s only blockaction:interact/decompressor
# --- Copper Block 1x → Copper Ingot 9x ---
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:copper_block run particle minecraft:dust{color:[0.88,0.55,0.25],scale:1.5} ~ ~1 ~ 0.3 0.5 0.3 0.1 15
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:copper_block run playsound minecraft:block.anvil.break block @a ~ ~ ~ 1 1.5
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:copper_block run clear @s minecraft:copper_block 1
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:copper_block run give @s minecraft:copper_ingot 9
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:copper_block run advancement revoke @s only blockaction:interact/decompressor
# --- Coal Block 1x → Coal 9x ---
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:coal_block run particle minecraft:dust{color:[0.1,0.1,0.1],scale:1.5} ~ ~1 ~ 0.3 0.5 0.3 0.1 15
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:coal_block run playsound minecraft:block.anvil.break block @a ~ ~ ~ 1 1.5
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:coal_block run clear @s minecraft:coal_block 1
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:coal_block run give @s minecraft:coal 9
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:coal_block run advancement revoke @s only blockaction:interact/decompressor
# --- Redstone Block 1x → Redstone 9x ---
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:redstone_block run particle minecraft:dust{color:[1.0,0.0,0.0],scale:1.5} ~ ~1 ~ 0.3 0.5 0.3 0.1 15
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:redstone_block run playsound minecraft:block.anvil.break block @a ~ ~ ~ 1 1.5
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:redstone_block run clear @s minecraft:redstone_block 1
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:redstone_block run give @s minecraft:redstone 9
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:redstone_block run advancement revoke @s only blockaction:interact/decompressor
# --- Lapis Block 1x → Lapis Lazuli 9x ---
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:lapis_block run particle minecraft:dust{color:[0.2,0.3,0.9],scale:1.5} ~ ~1 ~ 0.3 0.5 0.3 0.1 15
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:lapis_block run playsound minecraft:block.anvil.break block @a ~ ~ ~ 1 1.5
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:lapis_block run clear @s minecraft:lapis_block 1
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:lapis_block run give @s minecraft:lapis_lazuli 9
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:lapis_block run advancement revoke @s only blockaction:interact/decompressor
# --- Netherite Block 1x → Netherite Ingot 9x ---
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:netherite_block run particle minecraft:dust{color:[0.25,0.15,0.1],scale:1.5} ~ ~1 ~ 0.3 0.5 0.3 0.1 15
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:netherite_block run playsound minecraft:block.anvil.break block @a ~ ~ ~ 1 1.5
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:netherite_block run clear @s minecraft:netherite_block 1
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:netherite_block run give @s minecraft:netherite_ingot 9
execute if score @s count matches 1.. if items entity @s weapon.mainhand minecraft:netherite_block run advancement revoke @s only blockaction:interact/decompressor