GeyserMC / Geyser

A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
https://geysermc.org
MIT License
4.74k stars 686 forks source link

PlayerToggleFlightEvent doesn't fire #4184

Closed TheTobiCraft1 closed 1 year ago

TheTobiCraft1 commented 1 year ago

Describe the bug

Bukkit PlayerToggleFlightEvent doesn't fire when I toggle flight in creative mode or with allow flight enabled. In 1.20 it worked.

To Reproduce

  1. download latest build for geyser 1.20.1
  2. listen to the PlayerToggleFlightEvent
  3. start server with geyser 1.20.1
  4. join with bedrock client
  5. toggle flight | event won't fire

Expected behaviour

The PlayerToggleFlightEvent should fire. On java it works just fine.

Screenshots / Videos

No response

Server Version and Plugins

No response

Geyser Dump

No response

Geyser Version

2.2.0-SNAPSHOT (git-master-89d7225)

Minecraft: Bedrock Edition Device/Version

1.20.31, Windows

Additional Context

No response

ArturoAtomplay commented 1 year ago

you are right the event is not triggered here is an example code to test it in the game

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {
        Player player = e.getPlayer();
        player.setAllowFlight(true);
    }
    @EventHandler(priority = EventPriority.HIGH)
    public void onPlayerDoubleJump(PlayerToggleFlightEvent e) {
        Player player = e.getPlayer();

        e.setCancelled(true);
        player.setFlying(false);

        player.setVelocity(player.getLocation().getDirection().multiply(3).setY(1));
     }
onebeastchris commented 1 year ago

Should be fixed with https://github.com/GeyserMC/Geyser/pull/4198 - mind testing it? The build can be downloaded in the Checks tab on the PR.

TheTobiCraft1 commented 1 year ago

Thanks

onebeastchris commented 1 year ago

This is not yet fixed, but will be once the PR is merged - itll be closed automatically then :) Additionally, can you test said PR?