fix: we should cancel the original target event instead of our own version (#3163)

This commit is contained in:
ZX夏夜之风 2024-10-23 23:45:01 +08:00 committed by GitHub
parent 4d1b5a79b7
commit 767a73a479
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -453,7 +453,7 @@ public class EventListen implements Listener {
targetNPCEvent.setCancelled(!npc.data().get(NPC.Metadata.TARGETABLE, !npc.isProtected()));
Bukkit.getPluginManager().callEvent(targetNPCEvent);
if (targetNPCEvent.isCancelled()) {
targetNPCEvent.setCancelled(true);
event.setCancelled(true);
}
}