Closed Xemorr closed 3 months ago
Original issue: https://github.com/GeyserMC/Geyser/issues/2339
Can you attach example code? I have this and Java players don't persist in gliding without an elytra:
Bukkit.getCommandMap().register(this.getName(), new Command("iwanttobreakfree") {
@Override
public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args) {
if (sender instanceof Player player) {
player.setGliding(true);
}
return false;
}
});
OK I realized I didn't work with the toggle glide event but I still can't figure out how to get this working on Java so some sample code would be appreciated.
@EventHandler
public void onGlideStop(EntityToggleGlideEvent e) {
if (e.getEntity() instanceof Player) {
Player player = (Player) e.getEntity();
ItemStack helmet = player.getInventory().getHelmet();
if (helmet == null) return;
if (!isEqual(helmet, getGlider())) return;
if (!e.isGliding()) {
e.setCancelled(true);
}
}
}
This was some code where if you were wearing a certain helmet it would allow you to glide, you can obviously remove those lines the main bit that's important is if (!e.isGliding()) then cancel it as that prevents you from un gliding. then you just set that player to gliding true. Normally I would include a check that if you're on ground it allows it to be cancelled so players can get out of the elytra but for testing that should be fine.
OK, so I can confirm Bedrock's behavior differs here but I'm not sure if we can address it. It seems like Bedrock refuses to glide without a glider, and will always try to de-glide on the ground without us doing anything.
So you can't glide without an elytra on at all?
I suspect there's more stringent code on the client that determines if it should be gliding or not.
Closing this issue in favor of it being documented on our current limitations page: https://wiki.geysermc.org/geyser/current-limitations/
Describe the bug
A common way of allowing players to use an elytra without wearing them is to set their gliding to true and then listen to the EntityToggleGlideEvent and only allow them to be set back to Gliding = false if they hit the ground etc. This doesn't work on a bedrock player unless they wear an elytra and then the code is executed on them. However, they can see other java players gliding without the elytra on, so it seems like it might not be a limitation, but a bug with the Geyser project.
To Reproduce
setGliding to true on the player Cancel the event in EntityToggleGlideEvent Notice how it works on Java players but not on Bedrock players
Expected behaviour
The Bedrock player will glide without needing to wear an elytra!
Screenshots / Videos
https://gyazo.com/be5067af897afd2b98a4b47870aaf0e5 https://gyazo.com/302623d301acb8719a2e348c111c4a64
Server Version and Plugins
[21:54:41 INFO]: Plugins (87): ActivityRewarder, AncientGates, Animatronics, ArcherPraise, ArmorStandTools, AxCommandHider, BetterRTP, BossShopPro, BuycraftX, ChangeSlots, ChatChat, ChestShop, ChestShop-towny, Chunky, Citizens, CombatLogX, CoreProtect, CrateReloaded, CrateReloadedReward, EnchantedBosses, EnchantedCombat, EnchantedCommands, EnchantedFollowers, EnchantedWarbands, EpicRename, es-balancing, ESChallenges, ESCrateAddon, esdonorbroadcast-satellite, ESEmoji, ESHolographicCitizens, ESMusicRegions, ESParticles, Essentials, EssentialsSpawn, ESTrading, ESWelcome, EternalTags, FastAsyncWorldEdit (WorldEdit), floodgate, Graves, GSit, HarderEnderDragon, HeadDatabase, HolographicDisplays, LootArrows, LuckPerms, LWC, Multiverse-Core, Multiverse-NetherPortals, MVdWPlaceholderAPI, NoClaimCamping, NoteBlockAPI, Notes, OpenInv, ParticlesLibrary, PlaceholderAPI, PlayerPoints, PlayerShopOverhaul, PlayerVaults, PronounsPP, ProtocolLib, PVPToggle, QuestsBossesAddon, ReportBook, ShowItem, SirBlobmanCore (SirBlobmanAPI, XSeries), SkillsLibrary2, SkillsLibraryParticles, SkyblockNPCs, spark, Superheroes, SuperheroesPlusUltra, SuperheroesWorldGuard, TAB, Towny, TownySkillsLibraryAddon, UserInterface, Vault, ViaBackwards, ViaVersion, VoidWarp, VoidWorld, VotingPlugin, WorldGuard, WorldGuard-Towny*, WorldGuardEvents
Geyser Dump
https://dump.geysermc.org/Xe90cTGnGTy8cnjDCGXlXzifk6dAwxHg
Geyser Version
Geyser version 2.0.7-SNAPSHOT (git-master-8dde4b4) (Java: 1.19.1 - 1.19.2, Bedrock: 1.19.0/1.19.2 - 1.19.21)
Minecraft: Bedrock Edition Device/Version
Minecraft Windows 10 Edition
Additional Context
This has existed since 1.17, I made an issue back then but it got closed when refactoring happened. This is a real issue and has existed for a while