Move minecarts in a path

Discussion in 'Plugin Development' started by Jordymt, Aug 13, 2014.

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

    Jordymt

    Hi,

    For a while now I'm working on a plugin to move minecarts in a specific path. I know it could be done in 2 ways;
    1) Move animals in a path and set the minecart as passenger
    2) Move the minecarts itselve

    I'd like to use the more easy way of doing it(2) and it probably has to be done with .setVelocity, I already have some code, but I'd really like some help. Perhaps; how would it work to let the minecart make a circle path?

    Would be nice with some help!
    Jordy
     
  2. Offline

    Totom3

    I found this little piece of code on this thread :
    Code:
    x = cx + r * cos(a)
    z = cz + r * sin(a)
    "Where r is the radius, cx,cz the origin, and a the angle from 0..2PI radians or 0..360 degrees."

    Then you update the angle n times per second and tp the minecart to the new location and it will go in a circle.
     
  3. Offline

    TheHandfish

    Also keep in mind "Y" is the upward force.
     
  4. Offline

    Totom3

    TheHandfish Oops, didn't notice that. Thanks for telling me. xD
     
    TheHandfish likes this.
Thread Status:
Not open for further replies.

Share This Page