Teleporting to coordinates

Discussion in 'Plugin Development' started by mgbeenieboy, Sep 2, 2014.

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

    mgbeenieboy

    Hello, I want a small warp plugin. It's not a plugin where you can create warps and teleport to them. It's a plugin which says, if you type /example you will be teleported to world Sampleworld, X 100, Y 64, Z 124.

    p.teleport( this expects a location )

    But I don't know how to declare this variable?!
     
  2. Offline

    Anrza

  3. Offline

    Bammerbom

    Anrza Isnt it:
    Location location= new Location(World, Double, Double, Double, Float, Float);
     
  4. Offline

    mgbeenieboy

    I tried a lot, but eclipse shows errors :(

    World plot_creative;
    Location gsc = new Location(plot_creative, 0, 65, 0);
    p.teleport(gsc);

    (It wanted me to create the variable for the world. I noticed that if I add the p.teleport(gsc), it also wants to initialize it.)

    And here

    Location gsc = new Location(World plot_creative, 0, 65, 0, 0.0, 0.0);

    "World" cannot be resolved. According to the apidocs page it is Location(World world, double x, double y, double z) which also won't work.
     
  5. Offline

    Anrza


    Sorry, you're right I mixed it up.
     
  6. Offline

    Bammerbom

  7. Offline

    Epicballzy

    The Location() only requires the world name, x, y, and z coords, but the 2 floats are for pitch and yaw (Optional)
    Just thought I'd let you know.
     
  8. Offline

    Necrodoom

    mgbeenieboy I suggesting learning some Java first so you know how objects and methods work.
     
  9. Offline

    Anrza

    mgbeenieboy Yea, you should learn Java before starting coding (or at least before posting about your problems on Bukkit forums). You don't have to, but you wont have a lot of people spamming all your stupid-question-threads with stuff like "I suggest learning Java".
     
Thread Status:
Not open for further replies.

Share This Page