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

Golden Apple and Golden Apple Enchanted

Comments in 'Plugin Development' started by SlowByStep, Dec 20, 2015.

  1. SlowByStep
    Offline

    SlowByStep New Member

    Joined:
    Nov 4, 2015
    Posts:
    14
    Minecraft User:
    PandaYTB
    Hello all!
    I have code :

    <?php

    namespace Savion;

    use pocketmine\plugin\PluginBase;
    use pocketmine\Server;
    use pocketmine\event\Listener;
    use pocketmine\Player;
    use pocketmine\event\player\PlayerItemConsumeEvent;
    use pocketmine\entity\Effect;

    class Main extends PluginBase implements Listener {

    public function onEnable(){
    $this->getServer()->getPluginManager()->registerEvents($this,$this);
    $this->getServer()->getLogger()->info("Activated");
    }

    public function eat(PlayerItemConsumeEvent $ev){

    $p=$ev->getPlayer();

    if($ev->getItem()->getId() === 322){

    $p->addEffect(Effect $effect)

    }
    }
    }

    They write that when you eat an apple to give you effects ?
    Sorry for my english ,i'm from Romania :)
    seby likes this.
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    So, what do you want now..?
  3. SlowByStep
    Offline

    SlowByStep New Member

    Joined:
    Nov 4, 2015
    Posts:
    14
    Minecraft User:
    PandaYTB
    For add effect Regeneration and Absortion ( Golden Apple eatable )
  4. SlowByStep
    Offline

    SlowByStep New Member

    Joined:
    Nov 4, 2015
    Posts:
    14
    Minecraft User:
    PandaYTB
    Player eat Golden Apple and give effects
  5. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    PHP:
    $p->addEffect(Effect::getEffect($id));
    AndrewBit likes this.
  6. TryoneLegendZzz
    Offline

    TryoneLegendZzz Active Member

    Joined:
    May 31, 2015
    Posts:
    201
    Minecraft User:
    SavionLegendZzz
    lol my plugin xD
  7. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    lol

Share This Page

Advertisement