Package net.minecraft.item
Class ArmorItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.ArmorItem
- All Implemented Interfaces:
ItemConvertible,Vanishable,Wearable
- Direct Known Subclasses:
DyeableArmorItem
public class ArmorItem extends Item implements Wearable
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings -
Field Summary
Fields Modifier and Type Field Description private Multimap<EntityAttribute,EntityAttributeModifier>attributeModifiersstatic DispenserBehaviorDISPENSER_BEHAVIORprotected floatknockbackResistanceprivate static UUID[]MODIFIERSprivate intprotectionprotected EquipmentSlotslotprivate floattoughnessprotected ArmorMaterialtypeFields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group -
Constructor Summary
Constructors Constructor Description ArmorItem(ArmorMaterial material, EquipmentSlot slot, Item.Settings settings) -
Method Summary
Modifier and Type Method Description booleancanRepair(ItemStack stack, ItemStack ingredient)static booleandispenseArmor(BlockPointer pointer, ItemStack armor)Multimap<EntityAttribute,EntityAttributeModifier>getAttributeModifiers(EquipmentSlot slot)intgetEnchantability()Gets the enchantability of an item.SoundEventgetEquipSound()ArmorMaterialgetMaterial()intgetProtection()EquipmentSlotgetSlotType()floatgetToughness()TypedActionResult<ItemStack>use(World world, PlayerEntity user, Hand hand)Called when an item is used by a player.Methods inherited from class net.minecraft.item.Item
appendStacks, appendTooltip, asItem, byRawId, canMine, damage, finishUsing, fromBlock, getDefaultStack, getDrinkSound, getEatSound, getFoodComponent, getGroup, getItemBarColor, getItemBarStep, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTooltipData, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, hasStoredInventory, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isIn, isItemBarVisible, isNetworkSynced, isSuitableFor, isUsedOnRelease, method_33261, onClicked, onCraft, onStackClicked, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, useOnBlock, useOnEntity
-
Field Details
-
MODIFIERS
-
DISPENSER_BEHAVIOR
-
slot
-
protection
private final int protection -
toughness
private final float toughness -
knockbackResistance
protected final float knockbackResistance -
type
-
attributeModifiers
-
-
Constructor Details
-
ArmorItem
-
-
Method Details
-
dispenseArmor
-
getSlotType
-
getEnchantability
public int getEnchantability()Gets the enchantability of an item. This specifies the ability of an item to receive enchantments when enchanted using an enchanting table. As the value increases, the amount and level of enchantments applied increase.If the value of this method is 0, the item cannot be enchanted using an enchanting table.
- Overrides:
getEnchantabilityin classItem
-
getMaterial
-
canRepair
-
use
Called when an item is used by a player. The use action, by default, is bound to the right mouse button.This method is called on both the logical client and logical server, so take caution when overriding this method. The logical side can be checked using
world.isClient().- Overrides:
usein classItem- Parameters:
world- the world the item was used inuser- the player who used the itemhand- the hand used- Returns:
- a typed action result that specifies whether using the item was successful. The action result contains the new item stack that the player's hand will be set to.
-
getAttributeModifiers
public Multimap<EntityAttribute,EntityAttributeModifier> getAttributeModifiers(EquipmentSlot slot)- Overrides:
getAttributeModifiersin classItem
-
getProtection
public int getProtection() -
getToughness
public float getToughness() -
getEquipSound
- Overrides:
getEquipSoundin classItem
-