Yea, Which method that let a player double jump when he double-tap into jump button ?( survival mode) Thanks!
Using public $jump make it ++ in JumpEvent and when $jump be 2 using Player::SetMotion you can do it.
The client doesn't send this packet when pressing the jump button while your are already in the air. So your Player::SetMotion would only be triggered on every second jump from the ground. I think that's why @Thunder33345 was especially asking for "in air jumps".
You can enable flying for the player after jumping and listen for the PlayerToggleFlightEvent. Of course you have to disable fly immediately after the second jump.
I agree to @SalmonDE, this is the only implementation I know without using additional actions like right click in the air using a predefined item.
i disagree since this wont work for laggy players it would be nice if fly isnt involved Code: // DoubleJump by FreeGamingHere public function setFlyOnJump(PlayerToggleFlightEvent $event) { $player = $event->getPlayer(); if($player->getLevel()->getFolderName() == $this->getServer()->getDefaultLevel()->getFolderName()) { if($event->isFlying() && $player->hasPermission("lobby.doublejump")) { $player->setFlying(false); $jump = $player->getLocation()->multiply(0, 0.001, 0); $jump->y = 1.1; $player->setMotion($jump); $event->setCancelled(true); } } } yeah this one also uses the fly check which might be unreliable for people who lags or intentional lagswitch
I was never implying that this was the right way to do. I was simply offering one solution to the op, which should work well enough for the majority of players.