$item->setCustomName(PvP Elixer); $player = $event->getPlayer(); if(count($player->getEffects()) != 3) { if($event->getItem()->getID() ==373) { $player->getInventory()->removeItem(Item::get(373, 0, 1)); $player->addEffect(Effect::getEffect(Effect::STRENGTH)->setAmplifier(3)->setDuration(100 * 20)); $player->addEffect(Effect::getEffect(Effect::SPEED)->setAmplifier(3)->setDuration(100 * 20)); $player->addEffect(Effect::getEffect(Effect::REGENERATION)->setAmplifier(3)->setDuration(100 * 20)); $player->addEffect(Effect::getEffect(Effect::JUMP_BOOST)->setAmplifier(3)->setDuration (100 * 20)); $player->addEffect(Effect::getEffect(Effect::HEALTH_BOOST)->setAmplifier(3)->setDuration (100 * 20)); $player->getLevel()->addSound(new \pocketmine\level\sound\LaunchSound($player)); } } } }
Yes many, you are trying to run before you can walk. Try looking over the code again, I noticed as I look at it that the first line has a syntax error. Goodluck