Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException when a Villager is Killed by a Creeper Explosion #22

Closed
tgwallace opened this issue Feb 5, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@tgwallace
Copy link

[22:01:11 ERROR]: Could not pass event EntityDeathEvent to VillagerSaver v1.4.0
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R3.entity.CraftCreeper cannot be cast to class org.bukkit.entity.TNTPrimed (org.bukkit.craftbukkit.v1_20_R3.entity.CraftCreeper and org.bukkit.entity.TNTPrimed are in unnamed module of loader java.net.URLClassLoader @5ce65a89)
at cl.mariofinale.VillagerSaver_Listener.getKillerEntity(VillagerSaver_Listener.java:50) ~[VillagerSaver.jar:?]
at cl.mariofinale.VillagerSaver_Listener.onEntityDeath(VillagerSaver_Listener.java:24) ~[VillagerSaver.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor257.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:git-Paper-405]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.4.jar:git-Paper-405]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.4.jar:git-Paper-405]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R3.event.CraftEventFactory.callEntityDeathEvent(CraftEventFactory.java:957) ~[paper-1.20.4.jar:git-Paper-405]
at net.minecraft.world.entity.LivingEntity.dropAllDeathLoot(LivingEntity.java:1837) ~[?:?]
at net.minecraft.world.entity.LivingEntity.die(LivingEntity.java:1731) ~[?:?]
at net.minecraft.world.entity.npc.AbstractVillager.die(AbstractVillager.java:228) ~[?:?]
at net.minecraft.world.entity.npc.Villager.die(Villager.java:696) ~[?:?]
at net.minecraft.world.entity.LivingEntity.hurt(LivingEntity.java:1556) ~[?:?]
at net.minecraft.world.level.Explosion.explode(Explosion.java:598) ~[paper-1.20.4.jar:git-Paper-405]
at net.minecraft.world.level.Level.explode(Level.java:1402) ~[?:?]
at net.minecraft.server.level.ServerLevel.explode(ServerLevel.java:1928) ~[?:?]
at net.minecraft.world.level.Level.explode(Level.java:1361) ~[?:?]
at net.minecraft.world.entity.monster.Creeper.explodeCreeper(Creeper.java:275) ~[?:?]
at net.minecraft.world.entity.monster.Creeper.tick(Creeper.java:162) ~[?:?]
at net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1409) ~[?:?]
at net.minecraft.world.level.Level.guardEntityTick(Level.java:1314) ~[?:?]
at net.minecraft.server.level.ServerLevel.lambda$tick$8(ServerLevel.java:916) ~[?:?]
at net.minecraft.world.level.entity.EntityTickList.forEach(EntityTickList.java:42) ~[paper-1.20.4.jar:git-Paper-405]
at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:896) ~[?:?]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1714) ~[paper-1.20.4.jar:git-Paper-405]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:446) ~[paper-1.20.4.jar:git-Paper-405]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1515) ~[paper-1.20.4.jar:git-Paper-405]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1216) ~[paper-1.20.4.jar:git-Paper-405]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.20.4.jar:git-Paper-405]
at java.lang.Thread.run(Thread.java:840) ~[?:?]

@MarioFinale
Copy link
Owner

Thank for reporting the issue!

@MarioFinale MarioFinale self-assigned this Apr 2, 2024
@MarioFinale MarioFinale added the bug Something isn't working label Apr 2, 2024
@MarioFinale MarioFinale changed the title Getting this error when a villager is killed by a creeper. Needs a check before attempting to cast to TNT. ClassCastException when a Villager is Killed by a Creeper Explosion Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants