Interface ICustomDamageItem

All Known Implementing Classes:
BattleMageArmorItem, SageArmorItem, WandItem, WarlockArmorItem, WizardArmorItem

public interface ICustomDamageItem
Exposing helper methods to define how to obtain/set the damage/max-damage for an item, especially used to avoid item destruction in normal cases.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    canBreak(net.minecraft.world.item.ItemStack stack)
    used to control whether the item can be broken or if it should stay at 0 durability
    default int
    getCustomMaxDamage(net.minecraft.world.item.ItemStack stack)
    you can use this to set custom max damage based on some events
    default void
    setCustomDamage(net.minecraft.world.item.ItemStack stack, int damage)
    exposing a new way to control when and how damage is set
  • Method Details

    • getCustomMaxDamage

      default int getCustomMaxDamage(net.minecraft.world.item.ItemStack stack)
      you can use this to set custom max damage based on some events
    • setCustomDamage

      default void setCustomDamage(net.minecraft.world.item.ItemStack stack, int damage)
      exposing a new way to control when and how damage is set
    • canBreak

      default boolean canBreak(net.minecraft.world.item.ItemStack stack)
      used to control whether the item can be broken or if it should stay at 0 durability