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

Checking For Enchants

Discussion in 'Plugin Help' started by ObeyBeastJj23, May 29, 2017.

  1. ObeyBeastJj23

    ObeyBeastJj23 Spider

    Messages:
    13
    I have been editing it as i speak to you with different ideas and stuff but it dosent work still as i have been rebooting my server and joining and testing it
     
  2. Hipster

    Hipster Zombie

    Messages:
    214
    PHP:
        if($item->hasEnchantments()){
                    foreach(
    $item->getEnchantments() as $e){
                        if(
    $e->getId() == 15){
                            
    $levelofenchant $e->getLevel();
                         
    //code
                        
    }
                    }
                }
     
    Last edited by a moderator: May 29, 2017
    MyNET and ObeyBeastJj23 like this.
  3. ObeyBeastJj23

    ObeyBeastJj23 Spider

    Messages:
    13
    but how would i implement this
     
  4. ObeyBeastJj23

    ObeyBeastJj23 Spider

    Messages:
    13
    After a phew things it now works perfect, thanks for the help, especially @Hipster
     
    Hipster likes this.
  5. Hipster

    Hipster Zombie

    Messages:
    214
    <3
     
  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.