So, everyone knows the stupid bug in Pocketmine: You get kicked for flying, if you are standing on a Chest or any other tile, like slabs, for too long. I have written a script, that kicks players only if they are in the air. It works fine. (Only to use with allow-flight=off)! Script: PHP: case 'player.flying': $player = $data; $underblock = $player->entity->level->getBlock(new Vector3($player->entity->x, $player->entity->y - 1, $player->entity->z)); $ID = $underblock->getID(); if($ID == 0){ $data->close("Flying (in air)"); } else { console($data->username." was prevented from kicking. ->".$ID); return false; } break; Theroratically, this works totally fine. It detects the flying and kicks it. Here a console log: 2014-05-01 12:16:50 [INFO] RedmonTV[/192.168.178.35:52700] logged out due to Flying (in air) The (in air) indicates, that the player was kicked trough my plugin. This was tested with a real fly mod. Now, when a player stands on a chest, this happens: 2014-05-01 12:19:33 RedmonTV was prevented from kicking. 2014-05-01 12:19:33 [INFO] RedmonTV left the game 2014-05-01 12:19:33 [INFO] RedmonTV[/192.168.178.35:58735] logged out due to flying The "flying" says, that the player was kicked by PocketMines anti-fly. But, it is turned off. Is there a way to cancel the "player.flying" event? Thanks...
That is what I had, but, as I said, you get kicked for "flying" when you're standing on Chests, Fences, Iron Bars, Slabs, Walls etc. for longer than 5 seconds...
There comes a point where making a workaround is more work than just fixing the bug and creating a pull request
how about set stuff like this: Code: case 'player.flying': $player = $data; $underblock = $player->entity->level->getBlock(new Vector3($player->entity->x, $player->entity->y - 1, $player->entity->z)); $ID = $underblock->getID(); if($ID == 0){ $data->close("Flying (in air)"); } else { ///////my added idea///////// //whitelist the all item ids except the air block// if($ID != 0){ console($data->username." was prevented from kicking. ->".$ID); return false; } ///////END\\\\\\\\\ } break; IM not sure if this works or not but hope u can add up another idea