https://github.com/AntiCheatPE/AntiCheatPE/blob/master/src/AntiCheatPE/EventListener.php i think it help you. just follow variable $speedpoints
i think you can check it with this lines: (not tested) PHP: public function onMove(PlayerMoveEvent $event){ $from = $event->getFrom(); $to = $event->getTo(); $speed = $from->distance($to); //now you can do whatever you like with $speed //if this doesnt work, then make a delay with 20 ticks and check the distance from the position before and after 20 ticks ^^}
It tried to use It say Your speed is 0.191901901919blabla when i running really fast it say your speed is 1.9292902902290blabla i used if($speed >= 1){ send message but dont say anything public function onMov11CCe(PlayerMoveEvent $event){ $from = $event->getFrom(); $to = $event->getTo(); $speed = $from->distance($to); $event->getPlayer()->sendMessage("Your speed is $speed"); //if this doesnt work, then make a delay with 20 ticks and check the distance from the position before and after 20 ticks ^^ if($speed >= 1){ $event->getPlayer()->sendMessage("Your speed"); } }
I'm curious why no one has answered this yet: PHP: $motion = $player->getMotion();$speed = sqrt(pow($motion->getX(),2) + pow($motion->getY(),2) + pow($motion->getZ(),2)); Is that wrong?
This thread is literally from FOUR YEARS AGO And you can simply have a check for the speed attribute and make it to a value you want it to be shown, instead of having to get motion.