Hello, I've been trying to change the speed of the player without an effect. I did some research and found out that apparently, you can modify the movement with something called Attribute. However, I am not sure if I did the code correctly(coded it like how it is in current PMMP's source code) but it doesn't seem to work. My code: PHP: public function speedTestModifier(PlayerRespawnEvent $event) : void { $player = $event->getPlayer(); if ($player->isOp()) { $attr = $player->getAttributeMap()->getAttribute(Attribute::MOVEMENT_SPEED); $attr->setValue($attr->getValue() * (2)); } } Am I missing something? Edit: No errors are shown in the console. The code just doesn't work.
That is the correct way to do it, it will work in other events but for this event you will have to schedule a task because of https://github.com/pmmp/PocketMine-MP/blob/stable/src/pocketmine/Player.php#L3840