Hi guys, what is id for add item poison And régénération please.. PHP: $player->getInventory()->addItem(new Item ($id help ?));
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
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.
https://github.com/PocketMine/PocketMine-MP/blob/php7-0.14/src/pocketmine/item/Potion.php And about potions being not implemented: send a pull request to fix it!