set tools unbreakable

Discussion in 'Development' started by hexmor, Jul 6, 2019.

  1. hexmor

    hexmor Baby Zombie

    Messages:
    143
    hi
    i need to set tools (hoes - swords - axes - Pickaxes) & bow unbreakable
    i mean there must be ultimate to use
    sry for bad english !
     
  2. hexmor

    hexmor Baby Zombie

    Messages:
    143
    guys help me please
     
  3. hexmor

    hexmor Baby Zombie

    Messages:
    143
    help me please .
     
  4. KielKing

    KielKing Zombie

    Messages:
    251
    GitHub:
    kielking
    you can check if your item is an instance of tool (to avoid unnecessary errors), then use the setUnbreakable function
    PHP:
    /** @var Tool $item */
    if($item instanceof Tool){
        
    $item->setUnbreakable();
    }
    please don't spam or bump old threads, if people want to help you, they will
     
  5. hexmor

    hexmor Baby Zombie

    Messages:
    143
    how to use this in PlayerItemHeldEvent or disable breakable in server ?
     

Share This Page

  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.