Interface ItemExtension


public interface ItemExtension
Extensions to Item, implement this on to your item.
  • Method Summary

    Modifier and Type
    Method
    Description
    default @Nullable net.minecraft.world.entity.EquipmentSlot
    getCustomEquipmentSlot(net.minecraft.world.item.ItemStack stack)
    Returns the EquipmentSlot for ItemStack.
    default void
    tickArmor(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player)
    Invoked every tick when this item is equipped.
  • Method Details

    • tickArmor

      default void tickArmor(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player)
      Invoked every tick when this item is equipped.
      Parameters:
      stack - the item stack
      player - the player wearing the armor
    • getCustomEquipmentSlot

      @Nullable default @Nullable net.minecraft.world.entity.EquipmentSlot getCustomEquipmentSlot(net.minecraft.world.item.ItemStack stack)
      Returns the EquipmentSlot for ItemStack.
      Parameters:
      stack - the item stack
      Returns:
      the EquipmentSlot, return null to default to vanilla's LivingEntity.getEquipmentSlotForItem(ItemStack)