Function consumeDurability

  • Damage an ItemStack.

    Parameters

    • item: ItemStack

      The ItemStack to be damaged.

    • value: number

      The durability to be removed.

    • Optionalentity: Entity

      The optional Entity which breaks this tool.

    Returns ItemStack | undefined

    the damaged ItemStack.