Posted August 4, 20169 yr I started to add in entities into my mod and everything seemed to be working correctly but when I tried to kill one, I got a Ticking Entity NPE. public class EntityWight extends EntityMob { public EntityWight(World worldIn) { super(worldIn); setSize(0.55F, 1.5F); stepHeight = 0.5F; isImmuneToFire = true; } @Override protected void initEntityAI() { tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(1, new EntityAIWander(this, 0.25D)); targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D); getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(32.0D); getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D); getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.5D); } @Override public boolean getCanSpawnHere() { return this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && super.getCanSpawnHere(); } @Override protected Item getDropItem() { return Items.BONE; } } ---- Minecraft Crash Report ---- // On the bright side, I bought you a teddy bear! Time: 8/4/16 12:42 PM Description: Ticking entity java.lang.NullPointerException: Ticking entity at net.minecraft.entity.ai.EntityLookHelper.setLookPositionWithEntity(EntityLookHelper.java:31) at net.minecraft.entity.ai.EntityAIAttackMelee.updateTask(EntityAIAttackMelee.java:114) at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:112) at net.minecraft.entity.EntityLiving.updateEntityActionState(EntityLiving.java:846) at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2392) at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:643) at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:56) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2218) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:342) at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:64) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2106) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:872) at net.minecraft.world.World.updateEntity(World.java:2073) at net.minecraft.world.World.updateEntities(World.java:1886) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:644) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:783) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) at java.lang.Thread.run(Thread.java:745) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Server thread Stacktrace: at net.minecraft.entity.ai.EntityLookHelper.setLookPositionWithEntity(EntityLookHelper.java:31) at net.minecraft.entity.ai.EntityAIAttackMelee.updateTask(EntityAIAttackMelee.java:114) at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:112) at net.minecraft.entity.EntityLiving.updateEntityActionState(EntityLiving.java:846) at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2392) at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:643) at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:56) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2218) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:342) at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:64) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2106) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:872) at net.minecraft.world.World.updateEntity(World.java:2073) -- Entity being ticked -- Details: Entity Type: nex.wight (nex.entity.hostile.EntityWight) Entity ID: 887 Entity Name: Wight Entity's Exact location: -331.94, 65.88, 152.38 Entity's Block location: World: (-332,65,152), Chunk: (at 4,4,8 in -21,9; contains blocks -336,0,144 to -321,255,159), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Entity's Momentum: 0.00, -0.08, 0.00 Entity's Passengers: [] Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace: at net.minecraft.world.World.updateEntities(World.java:1886) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:644) -- Affected level -- Details: Level name: New World All players: 1 total; [EntityPlayerMP['Player715'/219, l='New World', x=-329.30, y=65.88, z=152.34]] Chunk stats: ServerChunkCache: 662 Drop: 0 Level seed: 6570541280075044611 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 0 game time, 0 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: ~~ERROR~~ NullPointerException: null Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:783) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) at java.lang.Thread.run(Thread.java:745) -- System Details -- Details: Minecraft Version: 1.10.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_101, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 664759608 bytes (633 MB) / 1288699904 bytes (1229 MB) up to 1901592576 bytes (1813 MB) JVM Flags: 0 total; IntCache: cache: 1, tcache: 10, allocated: 0, tallocated: 0 FML: MCP 9.32 Powered by Forge 12.18.1.2011 8 mods loaded, 8 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.10.2-12.18.1.2011.jar) UCHIJAAAA Forge{12.18.1.2011} [Minecraft Forge] (forgeSrc-1.10.2-12.18.1.2011.jar) UCHIJAAAA nex{@VERSION@} [NetherEx] (NetherEx_main) UCHIJAAAA JEI{3.7.8.234} [Just Enough Items] (jei_1.10.2-3.7.8.234.jar) UCHIJAAAA mantle{1.10.2-0.10.4.jenkins163} [Mantle] (Mantle-1.10.2-0.10.4.jar) UCHIJAAAA tconstruct{1.10-2.3.3a.jenkins271} [Tinkers' Construct] (TConstruct-1.10-2.3.3a.jar) UCHIJAAAA worldedit{6.1.3} [WorldEdit] (worldedit-forge-mc1.9.4-6.1.3-dist.jar) Loaded coremods (and transformers): GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Pulsar/tconstruct loaded Pulses: - TinkerCommons (Enabled/Forced) - TinkerWorld (Enabled/Not Forced) - TinkerTools (Enabled/Not Forced) - TinkerSmeltery (Enabled/Not Forced) - TinkerGadgets (Enabled/Not Forced) - TinkerOredict (Enabled/Forced) - TinkerIntegration (Enabled/Forced) - TinkerFluids (Enabled/Forced) - TinkerMaterials (Enabled/Forced) Profiler Position: N/A (disabled) Player Count: 1 / 8; [EntityPlayerMP['Player715'/219, l='New World', x=-329.30, y=65.88, z=152.34]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge'
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.