1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

What damage is one last hit

Discussion in 'General discussion' started by Levi, Jun 29, 2018.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    i want to give player pickaxe with one more use whats the damage for it
     
  2. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    Please explain more...
     
  3. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    its a number setDamage()
     
  4. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    You could start with a new item, use Item->getMaxDurability(), subtract 1, then use Item->applyDamage() to get an item with 1 durability. If you have an item with the Unbreaking enchantment, it could have more than one use, I believe.
     
    KHAV likes this.
  5. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    i have unbreaking enchantments, what should i do with that
     
  6. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Oh, easier method. Item->setDamage(Item->getMaxDurability() - 1). That should ignore Unbreaking.
     
    HimbeersaftLP likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.