Detect player's speed?

Discussion in 'Plugin Development' started by Trevor1134, May 29, 2014.

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

    Trevor1134

    I would like to find out the speed of a player walking, sprinting, etc I have tried getVelocity and such, but I would like to find the max per action, i.e max run speed is 0.22D

    Any tips on how I can do this?
     
  2. Offline

    CraftCreeper6

    Trevor1134
    The normal speed with p.setWalkSpeed() is 0.2F so check if they are above 0.2F and do code... :)
     
  3. Offline

    Trevor1134

    CraftCreeper6 Yes, but I would also like to know sprinting, sneaking etc.
     
  4. Offline

    CraftCreeper6

    Trevor1134
    Research :) Or just add some debugs
    PlayerSneakEvent; p.getWalkSpeed() etc... Pretty simple if you ask me.
     
  5. Offline

    Trevor1134

    CraftCreeper6 Did research, no results. Tried debugs... I believe sneak event is only trigger when toggle, not when moving and sneaking... and getWalkSpeed is only showing the walk speed, and not the CURRENT walk speed. Meaning it is only appearing to display the default speed?
     
Thread Status:
Not open for further replies.

Share This Page