execute store result score #temp mol.chest_looted run kill @e[type=item,nbt={Item:{id:"minecraft:barrel"},Age:0s}]
execute if score #temp mol.chest_looted matches 0 store result score #temp mol.chest_looted run kill @e[type=item,nbt={Item:{id:"minecraft:barrel"},Age:0s}]
execute if data entity @s item.tag.mol.LootTable run function mol:tick/remove_chest/kill_item
execute if score #temp mol.chest_looted matches 1 run function mol:tick/remove_chest/drop_chest
kill @s