Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

  • Author

yeah i was looking through some stuff and i just need to know how to setup the event

  • 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

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!

You would do

 if(!player.capabilities.isCreativemode) 

 

Don't copy and paste spelling might not be right I typed this up on my phone.

  • Author

So that they are no longer in creative after they take off the armor so that it removes the effect

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 !.

  • Author

i want to check if their not in creative and i did add the ! but it just stops the effect altogether.

  • 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

@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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.