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

Potion ID Poison ? and Regeneration ?

Comments in 'Plugin Development' started by Ritch, Feb 16, 2016.

  1. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Hi guys, what is id for add item poison And régénération please..
    PHP:
    $player->getInventory()->addItem(new Item ($id help ?));
  2. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    Like this. If you want poison do Effect::get(Effect :: POISON);
    PHP:
    $efct Effect::getEffect(Effect::REGENERATION);
                    
    $regen_time 5;//5 seconds
                    
    $regen_amp 2;//amplifier
                    
    $efct->setDuration(20*$regen_time);//set duration
                    
    $efct->setAmplifier($regen_amp);//set amplifier
                    
    $efct->setVisible(true);//set visible particles
                    
    $player->addEffect($efct);//add to player
  3. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    I think he wants a potion not an effect...
    abxyHD, KubixQ and PEMapModder like this.
  4. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    There are no potions in PocketMine
  5. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Help code ?
  6. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    Potion ID : 373
    Splash Potion ID : 438
  7. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    There are no potions in PocketMine but since the forks are just....taking over, you can use Genisys or just copy-paste their potions code and use it.
  8. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    do yo have genysis 0.13.2 no-php7
  9. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    I'm using the PHP7 build but I can give you 0.13.2-php5 if you want!
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Muqsit likes this.

Share This Page

Advertisement