How to give item

Discussion in 'Plugin Help' started by MrSolik123, Sep 11, 2019 at 4:52 PM.

  1. MrSolik123

    MrSolik123 Spider

    Messages:
    13
    • how to give the player the item when they log on to the server?
     
  2. Mr174

    Mr174 Baby Zombie

    Messages:
    100
    GitHub:
    Mr174
    PHP:
    public function onJoin(PlayerJoinEvent $ev) { //The Joining event
            
    if (!$p->hasPlayedBefore()){ //If they haven't played the server before 
                
    $p->getInventory()->addItem(Item::get(ItemIds::STONE_AXE)); //Gives the player a stone axe
            
    }
        }
     

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.