SPIGOT-6925: Add minecraft:match_tool in LootContext

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot 2022-02-21 10:52:08 +11:00
parent 8216743085
commit 22136f3a05

View file

@ -95,6 +95,7 @@ public class CraftLootTable implements org.bukkit.loot.LootTable {
// If there is a player killer, damage source should reflect that in case loot tables use that information
setMaybe(builder, LootContextParameters.DAMAGE_SOURCE, DamageSource.playerAttack(nmsKiller));
setMaybe(builder, LootContextParameters.LAST_DAMAGE_PLAYER, nmsKiller); // SPIGOT-5603 - Set minecraft:killed_by_player
setMaybe(builder, LootContextParameters.TOOL, nmsKiller.getUseItem()); // SPIGOT-6925 - Set minecraft:match_tool
}
// SPIGOT-5603 - Use LootContext#lootingModifier