Creating a Superfast arrow that flyes further.

Discussion in 'Plugin Development' started by CevinWa, Oct 16, 2012.

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

    CevinWa

    I've stumbled on set velocity but can't figure out how to do this so any help would be much appruciated
    Thanks
    //CevinWa
     
  2. Offline

    Hoolean

    What don't you understand?
     
  3. Offline

    CevinWa

    Nope I do not.
     
  4. Offline

    Hoolean

    No, what part of setVelocity do you understand? I know you don't understand it but which bit of it do you not understand?
     
    ZeusAllMighty11 likes this.
  5. Offline

    CevinWa

    Just the vector part. is it like this ? setVelocity(Vector.getMaximum(null, null));
     
  6. Offline

    Hoolean

    Code:java
    1. setVelocity(new Vector(/* x speed */, /* y speed */, /* z speed */)


    Check out Vector
     
  7. Offline

    CevinWa

    Thank you very much.

    This is my code. my arrow shoots faster but only in one direction
    player.shootArrow().setVelocity(new Vector( 7,0,7));
    cant you just do this instead
    Arrow arrow = player.shootArrow();
    arrow.setVelocity(arrow.getVelocity() * 2);

    or something

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

    Courier

    Java doesn't have operator overloading. You need to use: arrow.setVelocity(arrow.getVelocity().multiply(2));
     
  9. Offline

    CevinWa

    You my man just made my day
     
    MrBluebear3 likes this.
Thread Status:
Not open for further replies.

Share This Page