When coding add-on loot tables using the condition match tool players can use their hands instead of the designated tool to obtain the loot.
Steps to Reproduce:
Code a loot table file for either an entity or block.
Include in the loot table file the following match tool condition code:
{
"condition": "match_tool",
"item": "minecraft:gold_sword"
}
Use your empty hand instead of the Gold Sword to make the entity drop the item
Observed Results:
Item will drop when using empty hand slot
Expected Results:
Item does not drop when using empty hand
Attachments
Comments 4

Hello.
I've attached an example
that replaces the cow's loot table with one that uses the "match_tool" condition.
The cow should drop an apple when killed with a wooden sword.
This does work when tested, but if the cow is killed with your bare hand, it still drops an apple.
Here is the cow.json loot table included in the Example Pack.
{
"pools": [
{
"conditions": [
{
"condition": "killed_by_player"
},
{
"condition": "match_tool",
"item": "minecraft:wooden_sword"
}
],
"rolls": 1,
"entries": [
{
"type": "item",
"name": "minecraft:apple",
"weight": 1
}
]
}
]
}
Hello.
I've attached an example
that replaces the cow's loot table with one that uses the "match_tool" condition.
The cow should drop an apple when killed with a wooden sword.
This does work when tested, but if the cow is killed with your bare hand, it still drops an apple.
Here is the cow.json loot table included in the Example Pack.
{
"pools": [
{
"conditions": [
{
"condition": "killed_by_player"
},
{
"condition": "match_tool",
"item": "minecraft:wooden_sword"
}
],
"rolls": 1,
"entries": [
{
"type": "item",
"name": "minecraft:apple",
"weight": 1
}
]
}
]
}