This is my task code PHP: <?phpnamespace HotshotHD;use pocketmine\scheduler\PluginTask;use pocketmine\plugin\Plugin;use pocketmine\Player;use pocketmine\entity\Effect;class Task extends PluginTask { public function __construct(Plugin $owner, Player $player) { parent::__construct($owner); $this->player = $player; } public function onRun($currentTick) { $effectid = 1; $effectamp = 0; $effectvis = false; $effectdu = 50000000000000000; $effect = Effect::getEffect($effectid); $effect->setVisible(false); $effect->setDuration($effectdu); $effect->setAmplifier($effectamp); } public function cancel() { $this->getHandler()->cancel(); } }?> And I'm trying to call on it in the PlayerDeathEvent like this PHP: $this->getServer()->getScheduler()->scheduleDelayedTask(new Task($this, $player), 100); but it doesn't work. No error messages or anything. Can anyone help?
Never I mind. I figured out the problem. I forgot to add PHP: $this->player->addEffect($effect); My bad on that.