Package net.minecraft.world.item
Class ArmorItem
java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.ArmorItem
- All Implemented Interfaces:
FeatureElement
,Equipable
,ItemLike
,IItemExtension
- Direct Known Subclasses:
AnimalArmorItem
,CustomArmorModelTest.EndermanArmorItem
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.item.Item
Item.Properties, Item.TooltipContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Supplier
<ItemAttributeModifiers> static final DispenseItemBehavior
protected final Holder
<ArmorMaterial> protected final ArmorItem.Type
Fields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, canRepair, DEFAULT_MAX_STACK_SIZE, MAX_BAR_WIDTH
Fields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES
-
Constructor Summary
ConstructorsConstructorDescriptionArmorItem
(Holder<ArmorMaterial> pMaterial, ArmorItem.Type pType, Item.Properties pProperties) -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
dispenseArmor
(BlockSource pBlockSource, ItemStack pArmorItem) int
int
float
getType()
boolean
isValidRepairItem
(ItemStack pToRepair, ItemStack pRepair) Return whether this item is repairable in an anvil.use
(Level pLevel, Player pPlayer, InteractionHand pHand) Called to trigger the item's "innate" right click behavior.Methods inherited from class net.minecraft.world.item.Item
appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getBreakingSound, getCraftingRemainingItem, getDefaultInstance, getDefaultMaxStackSize, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getId, getName, getOrCreateDescriptionId, getPlayerPOVHitResult, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, hurtEnemy, initializeClient, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isRepairable, mineBlock, modifyDefaultComponentsFrom, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, 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
applyEnchantments, canBeHurtBy, canContinueUsing, canDisableShield, canElytraFly, canEquip, canGrindstoneRepair, canPerformAction, canWalkOnPowderedSnow, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAllEnchantments, getArmorTexture, getBurnTime, getCraftingRemainingItem, getCreatorModId, getDamage, getDefaultAttributeModifiers, getEnchantmentLevel, getEnchantmentValue, getEntityLifespan, getEquipmentSlot, getFoodProperties, getHighlightTip, getMaxDamage, getMaxStackSize, getSweepHitBox, getXpRepairRatio, hasCraftingRemainingItem, hasCustomEntity, isBookEnchantable, isDamageable, isDamaged, isEnderMask, isNotReplaceableByPickAction, isPiglinCurrency, isPrimaryItemFor, makesPiglinsNeutral, onAnimalArmorTick, onDestroyed, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onEntitySwing, onItemUseFirst, onLeftClickEntity, onStopUsing, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, supportsEnchantment
-
Field Details
-
DISPENSE_ITEM_BEHAVIOR
-
type
-
material
-
defaultModifiers
-
-
Constructor Details
-
ArmorItem
public ArmorItem(Holder<ArmorMaterial> pMaterial, ArmorItem.Type pType, Item.Properties pProperties)
-
-
Method Details
-
dispenseArmor
-
getType
-
getEnchantmentValue
public int getEnchantmentValue()- Overrides:
getEnchantmentValue
in classItem
-
getMaterial
-
isValidRepairItem
Return whether this item is repairable in an anvil.- Overrides:
isValidRepairItem
in classItem
-
use
Called to trigger the item's "innate" right click behavior. To handle when this item is used on a Block, seeinvalid reference
#onItemUse
-
getDefaultAttributeModifiers
- Overrides:
getDefaultAttributeModifiers
in classItem
-
getDefense
public int getDefense() -
getToughness
public float getToughness() -
getEquipmentSlot
- Specified by:
getEquipmentSlot
in interfaceEquipable
-
getEquipSound
- Specified by:
getEquipSound
in interfaceEquipable
-