kangarko / Boss

Premium custom monsters plugin with skill system, natural spawning and lots of sickest features!
https://www.mc-market.org/resources/21619/
77 stars 28 forks source link

1.8.8: Console Error with Citizens when spawning a new boss #1154

Closed IceGames23 closed 1 year ago

IceGames23 commented 1 year ago

This error appers when I spawn a new boss with Citizens hook with an egg. The first time was when a create a NPC boss and tried to spawn the boss, the boss works well I think, but this error is sended in console. I'm using the latest version of Citizens and Boss, FlamePaper, Java 17 and NashornPlus-1.3.0.

[19:43:43 ERROR]: [Citizens] Cannot register a null trait. Was it registered properly? [19:43:43 ERROR]: Could not pass event PlayerInteractEvent to Boss v4.7.6 org.bukkit.event.EventException: null at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:74) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:228) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:195) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:191) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:726) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:52) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:840) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:368) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:775) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:611) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at net.minecraft.server.v1_8_R3.MinecraftServer.lambda$0(MinecraftServer.java:133) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] at java.lang.Thread.run(Thread.java:833) ~[?:?] Caused by: java.lang.NullPointerException: Cannot assign field "health" because the return value of "net.citizensnpcs.api.npc.NPC.getOrAddTrait(java.lang.Class)" is null at org.mineacademy.boss.hook.CitizensHook.spawn(CitizensHook.java:94) ~[Boss-4.7.6.jar:?] at org.mineacademy.boss.model.Boss.summonEntity(Boss.java:907) ~[Boss-4.7.6.jar:?] at org.mineacademy.boss.model.Boss.spawn(Boss.java:840) ~[Boss-4.7.6.jar:?] at org.mineacademy.boss.listener.PlayerListener.onClick(PlayerListener.java:234) ~[Boss-4.7.6.jar:?] at jdk.internal.reflect.GeneratedMethodAccessor131.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) ~[FlamePaper.jar:git-PaperSpigot-e6e9d3ef] ... 20 more

kangarko commented 1 year ago

Thanks, gonna fix it but your old version might not always function with custom health we can only hide the error.

IceGames23 commented 1 year ago

Costom health only not works well when the integration with Citizens it's activated, but when it's without works normally

kangarko commented 1 year ago

Thats expected with 1.8.8 and Citizens, it is a limitation with said plugin and your many years old version