Posted May 14, 201312 yr Hello, last night I was working on some armor effects such as when you have a full set on, the effect comes and if you take a piece off it goes away. It works and all, except for the problem if I take off the chestplate first for some reason it crashes my game giving me this: Generated 5/14/13 9:06 AM -- Head -- Stacktrace: at vanillaplus.GemsArmorObsidian.onArmorTickUpdate(GemsArmorObsidian.java:34) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:348) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:594) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:858) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:341) -- Player being ticked -- Details: Entity Type: null (net.minecraft.entity.player.EntityPlayerMP) Entity ID: 398 Entity Name: Player855 Entity's Exact location: -31.51, 67.00, 246.70 Entity's Block location: World: (-32,67,246), Chunk: (at 0,4,6 in -2,15; contains blocks -32,0,240 to -17,255,255), 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 Stacktrace: at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:325) at net.minecraft.network.NetServerHandler.handleFlying(NetServerHandler.java:308) at net.minecraft.network.packet.Packet10Flying.processPacket(Packet10Flying.java:51) at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:134) at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:53) at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:678) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:574) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:132) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:469) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) -- System Details -- Details: Minecraft Version: 1.5.2 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_21, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 932020968 bytes (888 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 4705 (263480 bytes; 0 MB) allocated, 4346 (243376 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 2, tcache: 0, allocated: 1, tallocated: 63 FML: MCP v7.51 FML v5.2.2.684 Minecraft Forge 7.8.0.684 4 mods loaded, 4 mods active mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{5.2.2.684} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{7.8.0.684} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available VanillaPlus{1.2.0} [VanillaPlus] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 998 (55888 bytes; 0 MB) allocated, 992 (55552 bytes; 0 MB) used Player Count: 1 / 8; [EntityPlayerMP['Player855'/398, l='New World', x=-31.51, y=67.00, z=246.70]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' java.lang.NullPointerException at vanillaplus.GemsArmorObsidian.onArmorTickUpdate(GemsArmorObsidian.java:34) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:348) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:594) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:858) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:341) at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:325) at net.minecraft.network.NetServerHandler.handleFlying(NetServerHandler.java:308) at net.minecraft.network.packet.Packet10Flying.processPacket(Packet10Flying.java:51) at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:134) at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:53) at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:678) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:574) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:132) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:469) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) --- END ERROR REPORT 1f19c2dc ---------- Now here is my code that does all of this, it's in my EnderArmor Item Class: package vanillaplus; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; import net.minecraftforge.common.IArmorTextureProvider; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ArmorEnder extends ItemArmor implements IArmorTextureProvider { public ArmorEnder(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); this.setCreativeTab(VanillaPlus.VanillaPlusTabArmor); } @Override public String getArmorTextureFile(ItemStack itemstack) { if (itemstack.itemID == VanillaPlus.enderHelmet.itemID || itemstack.itemID == VanillaPlus.enderPlate.itemID || itemstack.itemID == VanillaPlus.enderBoots.itemID) { return "/mods/VanillaPlus/textures/armor/ender_1.png"; } if (itemstack.itemID == VanillaPlus.enderLegs.itemID) { return "/mods/VanillaPlus/textures/armor/ender_2.png"; } else { return null; } } @Override public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { if (player.getCurrentItemOrArmor(4) != null && player.getCurrentArmor(3) != null && player.getCurrentItemOrArmor(2) != null && player.getCurrentItemOrArmor(1) != null) { ItemStack helmet = player.getCurrentItemOrArmor(4); ItemStack plate = player.getCurrentItemOrArmor(3); ItemStack legs = player.getCurrentItemOrArmor(2); ItemStack boots = player.getCurrentItemOrArmor(1); if (helmet.getItem() == VanillaPlus.enderHelmet && plate.getItem() == VanillaPlus.enderPlate && legs.getItem() == VanillaPlus.enderLegs && boots.getItem() == VanillaPlus.enderBoots) { player.fallDistance = 0.0F; } } } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(VanillaPlus.modid + ":" + this.getUnlocalizedName().substring(5)); } } Thank you to anyone who can help me! I hope someone responds, also if I don't reply right away that is because I have school in about 10 min. so I'll respond when I get back ! Thanks!
May 15, 201312 yr you need to create a null check for the item stacks I think its my java of the variables.
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.