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
    doVanillaElytraTick(net.minecraft.entity.LivingEntity entity, net.minecraft.item.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.
    default boolean
    useCustomElytra(net.minecraft.entity.LivingEntity entity, net.minecraft.item.ItemStack chestStack, boolean tickElytra)
    Try to use this custom elytra.
  • Method Details

    • useCustomElytra

      default boolean useCustomElytra(net.minecraft.entity.LivingEntity entity, net.minecraft.item.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(net.minecraft.entity.LivingEntity entity, net.minecraft.item.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.