Package net.minecraft.world.item
Class ElytraItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ElytraItem
- All Implemented Interfaces:
FeatureElement
,Equipable
,ItemLike
,IItemExtension
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.Item
Item.Properties, Item.TooltipContext
-
Field Summary
Fields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, canRepair, DEFAULT_MAX_STACK_SIZE, MAX_BAR_WIDTH
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canElytraFly
(ItemStack stack, LivingEntity entity) Used to determine if the player can use Elytra flight.boolean
elytraFlightTick
(ItemStack stack, LivingEntity entity, int flightTicks) 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.static boolean
isFlyEnabled
(ItemStack p_41141_) boolean
isValidRepairItem
(ItemStack p_41134_, ItemStack p_41135_) use
(Level p_41137_, Player p_41138_, InteractionHand p_41139_) Methods inherited from class net.minecraft.world.item.Item
appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getBreakingSound, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDefaultMaxStackSize, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getId, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getRenderPropertiesInternal, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isRepairable, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, releaseUsing, requiredFeatures, toString, useOn, useOnRelease, verifyComponentsAfterLoad
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.item.Equipable
swapWithEquipmentSlot
Methods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
Methods inherited from interface net.neoforged.neoforge.common.extensions.IItemExtension
canApplyAtEnchantingTable, canContinueUsing, canDisableShield, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, getAllEnchantments, getArmorTexture, getAttributeModifiers, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, makesPiglinsNeutral, onAnimalArmorTick, onArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation
-
Constructor Details
-
ElytraItem
-
-
Method Details
-
isFlyEnabled
-
isValidRepairItem
- Overrides:
isValidRepairItem
in classItem
-
use
public InteractionResultHolder<ItemStack> use(Level p_41137_, Player p_41138_, InteractionHand p_41139_) -
canElytraFly
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 interfaceIItemExtension
- 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
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 interfaceIItemExtension
- 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
- Specified by:
getEquipSound
in interfaceEquipable
-
getEquipmentSlot
- Specified by:
getEquipmentSlot
in interfaceEquipable
-