Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using plugins to make players glide without elytras doesn't work #3255

Closed
Xemorr opened this issue Aug 26, 2022 · 8 comments
Closed

Using plugins to make players glide without elytras doesn't work #3255

Xemorr opened this issue Aug 26, 2022 · 8 comments
Labels
Can't Fix When (as of the information we know) it is impossible to fix Confirmed Bug The bug reported is confirmed and able to be replicated.

Comments

@Xemorr
Copy link

Xemorr commented Aug 26, 2022

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

image

[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

@Konicai
Copy link
Member

Konicai commented Aug 26, 2022

Original issue: #2339

@Camotoy
Copy link
Member

Camotoy commented Aug 27, 2022

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;
            }
});

@Camotoy
Copy link
Member

Camotoy commented Aug 27, 2022

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.

@Xemorr
Copy link
Author

Xemorr commented Aug 27, 2022

@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.

@Camotoy
Copy link
Member

Camotoy commented Aug 28, 2022

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.

@Camotoy Camotoy added Confirmed Bug The bug reported is confirmed and able to be replicated. Can't Fix When (as of the information we know) it is impossible to fix labels Aug 28, 2022
@Xemorr
Copy link
Author

Xemorr commented Aug 28, 2022

So you can't glide without an elytra on at all?

@Camotoy
Copy link
Member

Camotoy commented Aug 28, 2022

I suspect there's more stringent code on the client that determines if it should be gliding or not.

@onebeastchris
Copy link
Member

Closing this issue in favor of it being documented on our current limitations page: https://wiki.geysermc.org/geyser/current-limitations/

@onebeastchris onebeastchris closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can't Fix When (as of the information we know) it is impossible to fix Confirmed Bug The bug reported is confirmed and able to be replicated.
Development

No branches or pull requests

4 participants