al._0602

Aku mau add-on action stuff tapi ke texture dulu blok

Kodari AI
KodariJun 30 at 1:28 am 1

I’ll create a data pack that adds interactive Action Blocks with visual feedback using vanilla mechanics. Blocks that compress 9 items into 1 block (and decompress back).

BlockAction
Adds interactive action blocks that compress and decompress materials using vanilla data pack mechanics. Includes a Compressor block that converts 9 items into their block form and a Decompressor block for the reverse. Features particle effects, sound feedback, and custom crafting recipes for the action blocks.

All files created. BlockAction adds two interactive blocks:

Compressor Core (Chiseled Quartz Block) — Right-click holding 9+ of any supported item to compress into a block. Color-matched particles fire per material.

Decompressor Core (Chiseled Stone Bricks) — Right-click holding a block to split back into 9 items.

Supported materials: Iron, Gold, Diamond, Emerald, Copper, Coal, Redstone, Lapis Lazuli, Netherite

To use:

  1. Drop the BlockAction folder into world/datapacks/

  2. /reload — watch for the load message

  3. Craft a Compressor Core (chiseled_quartz_block) using quartz blocks + piston

  4. Craft a Decompressor Core (chiseled_stone_bricks) using stone bricks + sticky piston

  5. Place them, right-click with items

Kodari can make mistakes. Review important code before using.
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