hello, in my code is how add effect to player when respawns but it doesn't work, can anyone help me? PHP: public function onRespawn(PlayerRespawnEvent $event){ $player = $event->getPlayer(); $effect = Effect::getEffect(Effect::WEAKNESS); $effect->setAmplifier(0); $effect->setDuration(10000000); if($player->getDeviceOS() == 7){ $player->addEffect($effect); } } Console doesn't say anything
Actually amplifier=0 is the default value. And even with effectLevel=0 the effect should still show up.
There is no getDeviceOS function in the player class, this is what you're looking for: https://github.com/pmmp/PocketMine-...network/mcpe/protocol/LoginPacket.php#L51-L52
Sorry I doesn't spicified the effect only give for windows10 client, On playerjoin it works i don't know why in respawnevent doesn't work