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.

Caffe1ne

Members
  • Joined

  • Last visited

  1. I want to make a chestplate which grants the player an ability to fly upon equip. @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack){ ItemStack tmp; boolean chestplateWorn = !(tmp = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST)).isEmpty() && tmp.getItem() == TEST_CHESTPLATE; if(chestplateWorn) { player.capabilities.allowFlying = true; } if(!chestplateWorn) { player.capabilities.allowFlying = false; player.capabilities.isFlying = false; } } The adding flight part is fine, but removal is a bit messy. So if i have more than 1 armor piece in this class, player has to have another piece equipped for flight removal upon taking the chestplate off. And having any other setpieces but chestplate equipped disables the flight for items in other mods. If i move all other pieces apart from the chestplate to a different class, the flight removal stops working.But if i add any of the nonchestplace pieces back, it removes the flight. The best thing i can think of is just hardcoding all the equip variants for each piece into removal, but it doesnt seem like the right way. I've tried to adjust the removal check, but sadly it has no effect boolean helmetWorn = (tmp = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD)).isEmpty() || tmp.getItem() != TEST_HELMET || tmp.getItem() == TEST_HELMET; boolean leggingsWorn = (tmp = player.getItemStackFromSlot(EntityEquipmentSlot.LEGS)).isEmpty() || tmp.getItem() != TEST_LEGGINGS || tmp.getItem() == TEST_LEGGINGS; boolean bootstWorn = (tmp = player.getItemStackFromSlot(EntityEquipmentSlot.FEET)).isEmpty() || tmp.getItem() != TEST_BOOTS || tmp.getItem() == TEST_BOOTS; boolean remove = !chestplateWorn && helmetWorn && leggingsWorn && bootstWorn; if(remove){ player.capabilities.allowFlying = false; player.capabilities.isFlying = false; }

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.