Increasing Player Speed Efficiently with minimal "glitchiness" (no Potion effects)

Discussion in 'Plugin Development' started by Firefly, Jun 23, 2012.

Thread Status:
Not open for further replies.
  1. Offline


    Hey guys, I've encountered this issue a couple times in the past, without any luck increasing the player's speed without:

    A) Making the player lose the majority of direction controls


    B) Making the player go too fast, or flying infinitely into space.

    Anybody have a good solution that seems to be reasonably non-glitchy?
  2. Offline


    y not?
  3. Offline


    I'd rather avoid the skewing caused by the increased FoV and the particle effects emerging from the player. I would also like to control how much faster the player can move ;)
  4. Offline


    well u can use the setVelocity...
  5. Offline


    I realize that. I'm asking for some code that utilizes it in a usable sense. Every time I use setVelocity I end up as I stated above:

    I need a method that works close to flawlessly. I know, I'm asking for alot :p
  6. Offline


    Yea, I ran into the same issue, setting velocity on move caused a endless loop of "once moving, cant stop" since setting a vel made them move..which set a vel making them move..on and on.

    So gave up and applied speed potion :)
  7. Offline


    The exact approach I took :/ onPlayerMove + setVelocity = nightmare.

    Any ideas?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 26, 2016
  8. Offline


    What about using a teleport function instead of just increasing velocity? Then if the player stops holding forward, he will stop moving, and it will stop being called.

    Just an idea.
  9. Offline


    Not really what I'm going for here :/
  10. Offline


    I don't really see why not. That's what velocity basically does, it teleports the player every tick a certain amount based on their current velocity and future collisions.
  11. Offline


    There's not really any better way to do it then potions.
  12. try spout and spoutcraft?
  13. Offline


    I've managed to get the setVelocity working to adjust the player's speed as I see fit, but it's a bit choppy due to the delay between the server and client. The client wants to move at normal speed, but when the server says no, the client has to make adjustments, which causes choppiness. This was all tested locally and was used in my plugin, MorePhysics, for a while and even locally it was choppy. I eventually gave in and used potion effects.

    TL;DR: Even if you get a nice, working solution, it'll be a bit choppy and ugly. Potion Effects are your best bet.
  14. Offline


    This probably won't be useful but you run slightly faster on ice
  15. Offline

    XbannisherX could put a block infront of them, stopping them in there tracks
    when they stop holding down W
  16. You can't detect when they press W or not, if you could, the block thing wouldn't be required.

    Spout can do that tough, even tough it can get choppy (unless they implemented a method that changes player speed to the client so it gets smooth).
  17. I must say theres a methode at spoutPlayer called setWalkingMultiplier(double multiplier) that does it already (as far I know whitout getting it cchoppie)
  18. Offline


    Spoutcraft probably wouldn't be an option. Thanks for your tips, as I've seen with my own testing, potions are the best bet. :/
  19. Offline


  20. Offline


  21. Offline


  22. Offline


    Would you happen to have a bit of code showing what you managed to get using setVelocity() ?
  23. i tryed to code the same, a speed plugin without potion effects but i faild :(
  24. Offline


Thread Status:
Not open for further replies.

Share This Page