Posted September 11, 201411 yr Hey guys I want the Custom armor i already put into the game to allow flight when equipped and cancel the flying ability when unequipped. I tried using a method someone else put up a while ago: public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { if (player.getCurrentArmor(0) != null) { ItemStack helmet = player.getCurrentArmor(0); if (helmet.getItem() == RebornMod.head_phones) { player.fallDistance = 0.0F; player.capabilities.allowFlying = true; } } } currently when I use this it does nothing and when I try to @Override it asks for a supertype and i don't know what to put in the super. If anyone can help me fix, edit or change this method or create a new one that would be fantastic please help me asap
September 11, 201411 yr What class do you have this method in? You don't pit @override you put @subscribeevent and then you need to register the event in your main class.
September 11, 201411 yr Author yeah i was looking through some stuff and i just need to know how to setup the event
September 11, 201411 yr Author Forget what i said above its working but it still stays after i unequip the armor atleast untill i exit and reload the world
September 11, 201411 yr Set allowFlying and isFlying to false if the player is not in creative. I don't know if the method will be called though if you have taken off the armor. Maybe you'll have to use an event Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
September 11, 201411 yr You would do if(!player.capabilities.isCreativemode) Don't copy and paste spelling might not be right I typed this up on my phone.
September 12, 201411 yr Are you trying to check to see if the player is in creative or is not in creative?
September 12, 201411 yr Author So that they are no longer in creative after they take off the armor so that it removes the effect
September 12, 201411 yr That statement I posted checks to see if the player is not in creative mode If you want to check of the player is in creative mode just remove the !.
September 12, 201411 yr Author i want to check if their not in creative and i did add the ! but it just stops the effect altogether.
September 12, 201411 yr Author At this time it looks like event handler is the only route possible so it would be nice if someone could help me set that up
September 12, 201411 yr @SubscribeEvent public void armorBonus(PlayerTickEvent evt){ } Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
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.