so that wont work if they are in air, so your method is not very accurate for testing double tap of the jump button
To be real honest there is no proper way of detecting if someone is trying to fly in survival mode. None of the work arounds are consistend and reliable, you could check if a player hasn't been on the ground for so many seconds and kick him if that's the case, but it might as well be fall damage or huge lag.
This code checks whether a player is double-tapping the jump button and it enables flight (this does not trigger when just double tapping without hacking.). Didn't test it, but should work. PHP: public function onPacketReceive(DataPacketReceiveEvent $event){ $player = $event->getPlayer(); if($event->getPacket() instanceof AdventureSettingsPacket) { // Packet buffers // 37e60400 - Enable fly // 376600 - disable fly if(!$this->allowFlight && ($packet->flags >> 9) & 0x01 === 1) || (!$this->isSpectator() && ($packet->flags >> 7) & 0x01 === 1){ // Fly button used } }}