Teleport players?

Discussion in 'Plugin Development' started by MrGriefer_HGTech, Feb 15, 2015.

Thread Status:
Not open for further replies.
  1. Hi!

    I wanna know how can I teleport players to the Location on the config, For example:

    This is the config file:

    HTML:
    testing: <-- This is the arena name.
      world: world <-- The world of the arena.
      spawns:
        '0': <-- This is the number of spawns that the arena have.
          world: world <-- The World name that the spawn contains.
          x: 999.9
          y: 999.9
          z: 999.9
          pitch: 0.0
          yaw: 0.0
    So, how can I teleport players on that location?

    Thank you so much for reading!
    Sorry for my bad English.

    Also if someone can send me a link for Configuration file Wiki that will be nice, because I am really bad at config stuff!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  2. Offline

    Code0

    Datdenkikniet likes this.
  3. I tried to make:
    Code:
                          int locationsX = this.getConfig().getInt();
                          int locationsY = this.getConfig().getInt();
                          int locationsZ = this.getConfig().getInt();
                          int locationsYaw = this.getConfig().getInt();
                          int locationsPitch = this.getConfig().getInt();
                          World locationsworld = Bukkit.getWorld(this.getConfig().getString());
                
                          Location pvp = new Location(locationsworld, locationsX, locationsY, locationsZ, locationsYaw, locationsPitch);
                          p.teleport(pvp);
    But I don't know what do I put between the ".getInt(HERE);" I wanna know how can I get Arena name and the spawn world and the location of the spawn?

    Anyone?
     
    Last edited by a moderator: Feb 15, 2015
  4. Offline

    SuperOriginal

  5. @SuperOriginal I know I should do ".getInt("PATH");" but the thing here is that I wanna get the arena name, spawns, spawn id (Which is that 0 on top), world name, X, Y, and Z of the spawn location?
     
  6. Offline

    SuperOriginal

  7. Offline

    caderape

    @MrGriefer_HGTech

    if you wanna get the values of x, the path would be getint("testing.spawns.0.x")
     
  8. @caderape How can I get the arena name, for example /pvp join <ARENANAME> they will teleport to the name of the arena that they specify?
     
  9. @MrGriefer_HGTech Obviously you didn't look at the Wiki.
    1. X, Y, and Z are doubles.
    2. Pitch and Yaw are floats.
    3. The world is a String.
    4. Just check if their arguments match any of the arenas in the config, and then teleport the player to the coordinates.
     
    tomudding likes this.
  10. Offline

    NovaGamingBrian

  11. Offline

    SuperOriginal

    @NovaGamingBrian Having the X,Y,Z as doubles will allow more specific locations, rather than ints which round.
     
Thread Status:
Not open for further replies.

Share This Page