Class ElytraItem

java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ElytraItem
All Implemented Interfaces:
FeatureElement, Equipable, ItemLike, IItemExtension

public class ElytraItem extends Item implements Equipable
  • Constructor Details

  • Method Details

    • isFlyEnabled

      public static boolean isFlyEnabled(ItemStack pElytraStack)
    • isValidRepairItem

      public boolean isValidRepairItem(ItemStack pToRepair, ItemStack pRepair)
      Return whether this item is repairable in an anvil.
      Overrides:
      isValidRepairItem in class Item
    • use

      public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pHand)
      Called to trigger the item's "innate" right click behavior. To handle when this item is used on a Block, see
      invalid reference
      #onItemUse
      .
      Overrides:
      use in class Item
    • canElytraFly

      public boolean canElytraFly(ItemStack stack, LivingEntity entity)
      Description copied from interface: IItemExtension
      Used to determine if the player can use Elytra flight. This is called Client and Server side.
      Specified by:
      canElytraFly in interface IItemExtension
      Parameters:
      stack - The ItemStack in the Chest slot of the entity.
      entity - The entity trying to fly.
      Returns:
      True if the entity can use Elytra flight.
    • elytraFlightTick

      public boolean elytraFlightTick(ItemStack stack, LivingEntity entity, int flightTicks)
      Description copied from interface: IItemExtension
      Used to determine if the player can continue Elytra flight, this is called each tick, and can be used to apply ItemStack damage, consume Energy, or what have you. For example the Vanilla implementation of this, applies damage to the ItemStack every 20 ticks.
      Specified by:
      elytraFlightTick in interface IItemExtension
      Parameters:
      stack - ItemStack in the Chest slot of the entity.
      entity - The entity currently in Elytra flight.
      flightTicks - The number of ticks the entity has been Elytra flying for.
      Returns:
      True if the entity should continue Elytra flight or False to stop.
    • getEquipSound

      public Holder<SoundEvent> getEquipSound()
      Specified by:
      getEquipSound in interface Equipable
    • getEquipmentSlot

      public EquipmentSlot getEquipmentSlot()
      Specified by:
      getEquipmentSlot in interface Equipable