public class ArmorItem extends Item implements Wearable
Item.Settings
Modifier and Type | Field and Description |
---|---|
private Multimap<EntityAttribute,EntityAttributeModifier> |
attributeModifiers |
static DispenserBehavior |
DISPENSER_BEHAVIOR |
protected float |
knockbackResistance |
private static UUID[] |
MODIFIERS |
private int |
protection |
protected EquipmentSlot |
slot |
private float |
toughness |
protected ArmorMaterial |
type |
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group, RANDOM
Constructor and Description |
---|
ArmorItem(ArmorMaterial material,
EquipmentSlot slot,
Item.Settings settings) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRepair(ItemStack stack,
ItemStack ingredient) |
static boolean |
dispenseArmor(BlockPointer pointer,
ItemStack armor) |
Multimap<EntityAttribute,EntityAttributeModifier> |
getAttributeModifiers(EquipmentSlot slot) |
int |
getEnchantability()
Gets the enchantability of an item.
|
ArmorMaterial |
getMaterial() |
int |
getProtection() |
EquipmentSlot |
getSlotType() |
float |
method_26353() |
TypedActionResult<ItemStack> |
use(World world,
PlayerEntity user,
Hand hand)
Called when an item is used by a player.
|
appendStacks, appendTooltip, asItem, byRawId, canMine, damage, finishUsing, fromBlock, getDefaultStack, getDrinkSound, getEatSound, getFoodComponent, getGroup, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFireproof, isFood, isIn, isIn, isNetworkSynced, isUsedOnRelease, onCraft, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, useOnBlock, useOnEntity
private static final UUID[] MODIFIERS
public static final DispenserBehavior DISPENSER_BEHAVIOR
protected final EquipmentSlot slot
private final int protection
private final float toughness
protected final float knockbackResistance
protected final ArmorMaterial type
private final Multimap<EntityAttribute,EntityAttributeModifier> attributeModifiers
public ArmorItem(ArmorMaterial material, EquipmentSlot slot, Item.Settings settings)
public static boolean dispenseArmor(BlockPointer pointer, ItemStack armor)
public EquipmentSlot getSlotType()
public int getEnchantability()
If the value of this method is 0, the item cannot be enchanted using an enchanting table.
getEnchantability
in class Item
public ArmorMaterial getMaterial()
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand)
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()
.
use
in class Item
world
- the world the item was used inuser
- the player who used the itemhand
- the hand usedpublic Multimap<EntityAttribute,EntityAttributeModifier> getAttributeModifiers(EquipmentSlot slot)
getAttributeModifiers
in class Item
public int getProtection()
public float method_26353()