Posted July 22, 201312 yr What is the new code to add an effect to the player if a full set of armor is equipped . Also how could I make a double jump effect(while im in the air I can hump one more time)?
July 23, 201312 yr What is the new code to add an effect to the player if a full set of armor is equipped . Also how could I make a double jump effect(while im in the air I can hump one more time)? What is the old code ?
July 23, 201312 yr Author It was public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemstack) { ItemStack boots = player.getCurrentItemOrArmor(1); ItemStack legs = player.getCurrentItemOrArmor(2); ItemStack chest = player.getCurrentItemOrArmor(3); ItemStack helmet = player.getCurrentItemOrArmor(4); if(boots != null && legs != null && chest != null && helmet != null) { if(boots.getItem() == ModClass.boots.itemID && legs.getItem() == ModClass.legs.itemID && chest.getItem() == ModClass.chest.itemID && helmet.getItem() == ModClass.helmet.itemID) { //put the effect and stuff here } } } Now it gives an error that I can't have an int and item
July 23, 201312 yr helmet.getItem() == ModClass.helmet.itemID yeah... thsi makes no sens, this is literally the equivalent of comparing apples and hammers. To the eyes of the compiler this statement makes no sens. how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 24, 201312 yr Shouldn't you just get the itemID of the current worn boots, helmets etc and compare those with the itemID's of the armor id's which have the special effect? I have not tried to but i am not sure if theres a .getItemID for items. Otherwise you will have to find a different way to get the items ID. Perhaps you can even use boots.itemID. I am the creator of the Soul Forest Mod : http://www.planetminecraft.com/mod/151-soul-forest-10-ores-vines-dimension-mobs-and-more/
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.