Solved Why does this work?

Discussion in 'Plugin Development' started by Orange Tabby, Sep 30, 2015.

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

    Orange Tabby

    I was trying to spawn a fireball right in front of the players face and I randomly tried this for fun and it worked!
    I am in 7th grade there for 7th grade math standard, can someone please tell me why this works!

    Code:
    Entity f = loc.getWorld().spawnEntity(loc.add(loc.getDirection()), EntityType.FIREBALL);
    Edited: BTW the loc is the players location
    Thank you :D
    Have a cake [cake]
     
  2. Offline

    FabeGabeMC

    @Orange Tabby
    What an amazing interest when you're in 7th grade! By the way, welcome! (if you're new). :p
    And yes, this works because you are spawning a fireball in the location you want plus the direction.
    If you would like to know more about what methods do, click here. It will bring you to the JavaDocs.

    P.S. Thanks for the cake :p
     
    Orange Tabby likes this.
  3. Offline

    Orange Tabby

    @FabeGabeMC
    Okay Thanks for the help I'll be sure to check out the java docs!
    Here's that cake [cake]
    :D
     
    FabeGabeMC likes this.
Thread Status:
Not open for further replies.

Share This Page