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

Item Damage

Discussion in 'Facepalm' started by Hipster, Jun 12, 2017.

  1. Hipster

    Hipster Zombie

    Messages:
    214
    How to add or reduce damage on a tool or armor? It doesn't seem to work $item->setDamage($item->getDamage() + 2); is 2 less?
     
  2. Bintang Putra

    Bintang Putra Witch

    Messages:
    63
    GitHub:
    chaostixzix
    Try This, this will give item to player's inventory with 2 more damage, if you want to reduce it, then use - 2
    PHP:
    $item Item::get(27601);
    $item->setDamage($item->getDamage() + 2);
    $inventory $player->getInventory()
    $inventory->addItem($item);
     
  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.