Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Get player velocity

Comments in 'Plugin Development' started by MyNameIsTriXz, Mar 27, 2016.

  1. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    How can I get the player's velocity? $player->getMotion()->x? $player->getMotion()[0]? Or is it another function?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Use the Pythagoras's theorem? Seems getMotion() returns a Vector3.

    Also, using the Vector3->length() function might help you.

Share This Page

Advertisement