## Broken
execute unless block ~ ~ ~ minecraft:dropper run function vb:tick_entity/custom_block/bartering_station/broken

## Set block
execute if block ~ ~ ~ minecraft:dropper run setblock ~ ~ ~ minecraft:dropper[facing=up,triggered=true]
data merge block ~ ~ ~ {CustomName:{translate:"vb.custom_item.bartering_station"}}

## Give gold
execute as @e[type=piglin,distance=..20] unless items entity @s weapon.offhand * if items block ~ ~ ~ container.0 minecraft:gold_ingot run function vb:tick_entity/custom_block/bartering_station/give_gold {slot:0}
execute as @e[type=piglin,distance=..20] unless items entity @s weapon.offhand * if items block ~ ~ ~ container.1 minecraft:gold_ingot run function vb:tick_entity/custom_block/bartering_station/give_gold {slot:1}
execute as @e[type=piglin,distance=..20] unless items entity @s weapon.offhand * if items block ~ ~ ~ container.2 minecraft:gold_ingot run function vb:tick_entity/custom_block/bartering_station/give_gold {slot:2}
execute as @e[type=piglin,distance=..20] unless items entity @s weapon.offhand * if items block ~ ~ ~ container.3 minecraft:gold_ingot run function vb:tick_entity/custom_block/bartering_station/give_gold {slot:3}
execute as @e[type=piglin,distance=..20] unless items entity @s weapon.offhand * if items block ~ ~ ~ container.4 minecraft:gold_ingot run function vb:tick_entity/custom_block/bartering_station/give_gold {slot:4}
execute as @e[type=piglin,distance=..20] unless items entity @s weapon.offhand * if items block ~ ~ ~ container.5 minecraft:gold_ingot run function vb:tick_entity/custom_block/bartering_station/give_gold {slot:5}
execute as @e[type=piglin,distance=..20] unless items entity @s weapon.offhand * if items block ~ ~ ~ container.6 minecraft:gold_ingot run function vb:tick_entity/custom_block/bartering_station/give_gold {slot:6}
execute as @e[type=piglin,distance=..20] unless items entity @s weapon.offhand * if items block ~ ~ ~ container.7 minecraft:gold_ingot run function vb:tick_entity/custom_block/bartering_station/give_gold {slot:7}
execute as @e[type=piglin,distance=..20] unless items entity @s weapon.offhand * if items block ~ ~ ~ container.8 minecraft:gold_ingot run function vb:tick_entity/custom_block/bartering_station/give_gold {slot:8}