Topic category: Help with Minecraft modding (Java Edition)
Hey, my client is crashing when spider-type mobs interact with my custom block. I have a procedure on it to tick when block is collided with to act as cobweb (built in). Zombies, players, and supposedly other mobs work fine.
Any help is appreciated ;)
Here is the crash report:
Description: Colliding entity with block
java.lang.NullPointerException: Colliding entity with block
at net.minecraft.entity.monster.SpiderEntity.setMotionMultiplier(SpiderEntity.java:124) ~[?:?] {re:classloading}
at net.sapphyrine_mod.procedures.MetallicWebEntityCollidesInTheBlockProcedure.executeProcedure(MetallicWebEntityCollidesInTheBlockProcedure.java:22) ~[?:?] {re:classloading}
at net.sapphyrine_mod.block.MetallicWebBlock$CustomBlock.onEntityCollision(MetallicWebBlock.java:91) ~[?:?] {re:classloading}
at net.minecraft.block.BlockState.onEntityCollision(BlockState.java:284) ~[?:?] {re:classloading}
at net.minecraft.entity.Entity.doBlockCollisions(Entity.java:890) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.entity.Entity.move(Entity.java:621) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.entity.LivingEntity.travel(LivingEntity.java:1976) ~[?:?] {re:classloading}
at net.minecraft.entity.LivingEntity.livingTick(LivingEntity.java:2374) ~[?:?] {re:classloading}
at net.minecraft.entity.MobEntity.livingTick(MobEntity.java:507) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.entity.monster.MonsterEntity.livingTick(MonsterEntity.java:41) ~[?:?] {re:classloading}
at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2188) ~[?:?] {re:classloading}
at net.minecraft.entity.MobEntity.tick(MobEntity.java:311) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.entity.monster.MonsterEntity.tick(MonsterEntity.java:56) ~[?:?] {re:classloading}
at net.minecraft.entity.monster.SpiderEntity.tick(SpiderEntity.java:86) ~[?:?] {re:classloading}
at net.minecraft.world.server.ServerWorld.updateEntity(ServerWorld.java:602) ~[?:?] {re:classloading}
at net.minecraft.world.World.func_217390_a(World.java:734) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:397) ~[?:?] {re:classloading}
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:867) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:802) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:648) [?:?] {re:classloading,pl:accesstransformer:B}
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252] {}
Fixed this myself by creating a check before the cobweb effect is applied to check if it is a spider-type entity, then doing nothing if it is.