Flying Without Elytra / Player Elytra Flying Animation

Discussion in 'Plugin Development' started by sickray34s, Nov 4, 2018.

  1. [grass] Hi Everyone I wanted to know if anyone know How To Fake a Elytra Flying Animation so basically, Flying without equipping the item to start with; I also want to add adjustable velocity's so I can fly endlessly and can have the ability to double jump to from any height and fly upwards on a 45* angle. I'm sorry if this sounds mundane or basic. I recently got Back into plugin development after 2 years collage :cool: . So if anybody can point out A way to do this it would be greatly appreciated ;). I attached the image of the animation for anyone who says this post is confusing.


    On a side note if i have to use net.minecraft.server libraries [bookshelf] to accomplish this don't hesitate to post any available info to get this done. (I'm experienced enough i worked On Carbon 1.8 protocol hack plugin)

    -sickray34s :)
     

    Attached Files:

  2. Offline

    MrShnig

    It's quite simple. Check if a player isn't gliding, and then .setGliding(true).
    The only problem is, it's extremely glitchy and laggy even if it does work.
    If you put this:
    Code:
    if(!player.isOnGround() && player.getFallDistance >= 3) player.setGliding(true);
    in a PlayerMoveEvent detector, then whenever the falldistance is greater than or equal to 3, and the player isn't on the ground, then they'll be set to gliding. Again, without the elytra, it's basically unplayable.

    On another note, the speeding up at a 45* angle is also not that hard.

    To speed up a player, you get their velocity and multiply it by whatever number you want. If you multiply it by 0 that will stop them, needless to say.

    This will boost them in the direction they're looking in:
    Code:
    player.setVelocity(player.getEyeLocation().getDirection().multiply(2));
    Also needless to say, if you set it to .multiply(-2), it will boost them in the opposite direction of what they're facing.
    If you want it to boost them on an angle, compare their pitch to whatever angle you want, and then boost them.
    This might help: https://www.spigotmc.org/threads/pitch-and-yaw-help.40954/

    Positive pitch is straight down (90*), negative straight up (-90*), from what I've tested.

    Hope I helped!

    (P.S. Collage is gluing colored pieces of paper to make a picture, college is an educational institute :p)
     

Share This Page