Hey, since no one answered the previous thread I posted, here we go again with a furthermore issue with PocketMine-MP's attribute. After respawn, no matter what the heck you do, it won't set the attribute unless you restart your server. What could be the problem?
PHP: public function onToggle(PlayerToggleSneakEvent $event) { $player = $event->getPlayer(); $name = $player->getName(); $value = $this->plugin->speed->get($name); $attr = $player->getAttributeMap()->getAttribute(Attribute::MOVEMENT_SPEED); $attr->setValue($value); $player->sendMessage("Toggled sneak!"); // return message to check if the code is working } The code does return message, but the "setValue". Attribute doesn't want to work after respawn. I'll have to manually restart the server and rejoin to make it work