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 TypeMethodDescriptiondefault 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.default boolean
useCustomElytra
(LivingEntity entity, ItemStack chestStack, boolean tickElytra) Try to use this custom elytra.
-
Method Details
-
useCustomElytra
Try to use this custom elytra.- Parameters:
entity
- the entitychestStack
- the stack currently worn in the chest slot, will always be of this itemtickElytra
- true to tick the elytra, false to only perform the check; vanilla-like elytras can usedoVanillaElytraTick(net.minecraft.entity.LivingEntity, net.minecraft.item.ItemStack)
to handle ticking- Returns:
- true to enable elytra flight for the entity
-
doVanillaElytraTick
A helper to perform the default vanilla elytra tick logic: damage the elytra every 20 ticks, and send a game event every 10 ticks.
-