#getVelocity().setY(-0.3); not working

Discussion in 'Plugin Development' started by VortexGmer, May 20, 2015.

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


    #getVelocity().setY(-0.3); not working doesn't work. Although setting the velocity by .setVelocity(new Vector(0,-0,3,0)); does work Then the player cannot move around because of the zeroes. Any help?
  2. Offline


    @VortexGmer Try using getVelocity, store that Vector and then modify it, then apply it back with setVelocity
  3. Offline


    @VortexGmer #setVelocity(#getVelocity().setY(-0.3)) ?
  4. Offline


    When you use methods like get location and get vector it is returning a cloned version of the location/vector and therefore when you edit anything in that vector itself it will not affect the entity. Think of it as a read only situation. But as nverdier said, you can read, set the value you want, then apply it back.
    scrollbar likes this.
Thread Status:
Not open for further replies.

Share This Page