Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Exexute once per life!

Comments in 'Plugin Development' started by Primus, Apr 12, 2015.

  1. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Hello, i'm currently making a SimpleVIP Plugin, and i want the statement to give player Armor Kit once per life so he would get new armor after death!
    So this is my code that i want to execute:
    PHP:
     $e->getPlayer()->getInventory()->setHelmet(Item::get($this->getConfig()->get("Helmet")));
    $e->getPlayer()->getInventory()->setChestplate(Item::get($this->getConfig()->get("Chestplate")));
      
    $e->getPlayer()->getInventory()->setLeggings(Item::get($this->getConfig()->get("Leggings")));
                                                                 
    $e->getPlayer()->getInventory()->setBoots(Item::get($this->getConfig()->get("Boots"))); 
                    
    $p->sendMessage("[SVIP] You recieved your kit!");
                }else{
                    
    $this->getLogger()->info("[SVIP] Kit was'nt given to the VIP player, something went wrong"); 
  2. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    Execute it on PlayerRespawnEvent and you could also put it in there inventory when they join again if you wanted fresh gear all the time.

Share This Page

Advertisement