Posted January 29, 20232 yr Hello, I'm having an issue with getting players to use elytra flight. They do not have any elytra armour on their chest plate but rather the elytra is rendered on the player. What I've got so far seems to make the server 'fight' with itself making the person with the elytra begin flying but immediately go back to non-flight. I'm checking if the player is off the ground and such client and server side using packets. Client code: @SubscribeEvent(priority = EventPriority.HIGHEST) public static void onKeyInput(InputEvent.Key event) { if (Minecraft.getInstance().options.keyJump.consumeClick()) { Player player = Minecraft.getInstance().player; if (!player.isOnGround() && !player.isFallFlying() && !player.isInWater() && !player.hasEffect(MobEffects.LEVITATION)) { NetworkManager.sendToServer(new ElytraAttemptFlyPacket()); } } } } Server code: public class ElytraAttemptFlyPacket { public ElytraAttemptFlyPacket(FriendlyByteBuf buf) { } public ElytraAttemptFlyPacket() { } public void toBytes(FriendlyByteBuf buf) { } public boolean handle(Supplier<NetworkEvent.Context> supplier) { NetworkEvent.Context context = supplier.get(); context.enqueueWork(() -> { //Server ServerPlayer player = context.getSender(); if (!player.isOnGround() && !player.isFallFlying() && !player.isInWater() && !player.hasEffect(MobEffects.LEVITATION)) { player.startFallFlying(); } }); return true; } } As I said before it kind of works but it looks like the server is fighting with itself putting the player in elytra mode and normal mode. Any suggestions would be appreciated!! Edited January 31, 20232 yr by HixlePod Issue was solved using the Caelus API.
January 31, 20232 yr On 1/29/2023 at 1:59 PM, HixlePod said: I'm having an issue with getting players to use elytra flight. They do not have any elytra armour on their chest plate but rather the elytra is rendered on the player. There was a PR on adding a custom elytra item. Unless you're doing this without any items whatsoever, I would suggest using the system Forge already has hooked for you.
January 31, 20232 yr Author I am using the Caelus API to handle my elytra flight, so far it seems to have solved my issue. Thank you for your help though!!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.