Posted January 7, 201312 yr I am trying to make a new electricity system and when I try to find the tile entities around my block to determine the length of the wire it gives me an error, heres my code/error TileEntity var1 = worldObj.getBlockTileEntity(xCoord+1, yCoord, zCoord); TileEntity var2 = worldObj.getBlockTileEntity(xCoord-1, yCoord, zCoord); TileEntity var3 = worldObj.getBlockTileEntity(xCoord, yCoord+1, zCoord); TileEntity var4 = worldObj.getBlockTileEntity(xCoord, yCoord-1, zCoord); TileEntity var5 = worldObj.getBlockTileEntity(xCoord, yCoord, zCoord+1); TileEntity var6 = worldObj.getBlockTileEntity(xCoord, yCoord, zCoord-1); 2013-01-06 20:06:30 [iNFO] [sTDERR] java.lang.NullPointerException 2013-01-06 20:06:30 [iNFO] [sTDERR] at kore.mods.korecraft.TileEntityWire.findDistance(TileEntityWire.java:68) 2013-01-06 20:06:30 [iNFO] [sTDERR] at kore.mods.korecraft.TileEntityWire.<init>(TileEntityWire.java:12) 2013-01-06 20:06:30 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2013-01-06 20:06:30 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 2013-01-06 20:06:30 [iNFO] [sTDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 2013-01-06 20:06:30 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Unknown Source) 2013-01-06 20:06:30 [iNFO] [sTDERR] at java.lang.Class.newInstance0(Unknown Source) 2013-01-06 20:06:30 [iNFO] [sTDERR] at java.lang.Class.newInstance(Unknown Source) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.tileentity.TileEntity.createAndLoadEntity(TileEntity.java:138) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.world.chunk.storage.AnvilChunkLoader.readChunkFromNBT(AnvilChunkLoader.java:418) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.world.chunk.storage.AnvilChunkLoader.checkedReadChunkFromNBT(AnvilChunkLoader.java:103) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.world.chunk.storage.AnvilChunkLoader.loadChunk(AnvilChunkLoader.java:83) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.world.gen.ChunkProviderServer.safeLoadChunk(ChunkProviderServer.java:182) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:118) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:310) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:84) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:100) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458) 2013-01-06 20:06:30 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-01-06 20:06:30 [iNFO] [sTDOUT] Skipping TileEntity with id tileEntityWire The Korecraft Mod
January 7, 201312 yr Author Alright, I have found that the error is at .getBlockTileEntity, Please Help! The Korecraft Mod
January 8, 201312 yr looks like you are using the vars even if "worldObj.getBlockTileEntity(xCoord+1, yCoord, zCoord);" is null ...
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.