From c98b18d4a20b580645d7b569c06fd0367e554a5f Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 19 Sep 2024 06:45:18 +1000 Subject: [PATCH] SPIGOT-7904: Fix NPE for PlayerItemBreakEvent By: Doc --- .../nms-patches/net/minecraft/world/item/ItemStack.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/nms-patches/net/minecraft/world/item/ItemStack.patch b/paper-server/nms-patches/net/minecraft/world/item/ItemStack.patch index da106bbd37..1ea1ce3ee1 100644 --- a/paper-server/nms-patches/net/minecraft/world/item/ItemStack.patch +++ b/paper-server/nms-patches/net/minecraft/world/item/ItemStack.patch @@ -307,7 +307,7 @@ if (j >= this.getMaxDamage()) { Item item = this.getItem(); + // CraftBukkit start - Check for item breaking -+ if (this.count == 1) { ++ if (this.count == 1 && entityplayer != null) { + org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(entityplayer, this); + } + // CraftBukkit end