Interface FabricElytraItem


public interface FabricElytraItem
An interface that can be implemented on an item to provide custom elytra flight when it is worn in the EquipmentSlot.CHEST slot.

To disable cape rendering when this item is worn (like the vanilla elytra item), have a look at LivingEntityFeatureRenderEvents.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    A helper to perform the default vanilla elytra tick logic: damage the elytra every 20 ticks, and send a game event every 10 ticks.
    default boolean
    useCustomElytra(LivingEntity entity, ItemStack chestStack, boolean tickElytra)
    Try to use this custom elytra.
  • Method Details

    • useCustomElytra

      default boolean useCustomElytra(LivingEntity entity, ItemStack chestStack, boolean tickElytra)
      Try to use this custom elytra.
      Parameters:
      entity - the entity
      chestStack - the stack currently worn in the chest slot, will always be of this item
      tickElytra - true to tick the elytra, false to only perform the check; vanilla-like elytras can use doVanillaElytraTick(net.minecraft.entity.LivingEntity, net.minecraft.item.ItemStack) to handle ticking
      Returns:
      true to enable elytra flight for the entity
    • doVanillaElytraTick

      default void doVanillaElytraTick(LivingEntity entity, ItemStack chestStack)
      A helper to perform the default vanilla elytra tick logic: damage the elytra every 20 ticks, and send a game event every 10 ticks.