I have a loot table that makes it so logs only drop when mined with an axe; That part was easy. But I noticed it did not drop to creeper explosions/tnt due to failing the match tool check, which obviously I would like to fix if possible.
I am now having difficulties making it also drop from explosions and the below should work but does not seem to be.
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"name": "minecraft:acacia_log",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:wooden_axe",
"minecraft:stone_axe",
"minecraft:iron_axe",
"minecraft:golden_axe",
"minecraft:diamond_axe",
"minecraft:netherite_axe"
]
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:acacia_log",
"conditions": [
{
"condition": "minecraft:survives_explosion"
},
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"type": "minecraft:player"
}
}
}
]
}
]
}
]
}
]
}
What am I doing wrong? Why is it not dropping from tnt? Is that somehow passing the not-player check? I tried it with creepers too since maybe tnt lit by players still counts, and same thing.
conditions
array rather than as new objects because you already specifiedminecraft:acacia_log
in thechildren
array. But, I don't know what Minecraft expects.minecraft:survives_explosion
condition, which is programmed to fail if the explosion is too large or too close, which will stop the item from dropping at all.