Need Help Creating A Sign Teleportor

Discussion in 'Plugin Development' started by jay275475, Sep 5, 2013.

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

    jay275475

    I need help Making a Sign that says
    [Map]​
    Join​
    (WorldName)​
    Could Anyone help Me?​
     
  2. Offline

    Datdenkikniet

    sooo, what do you need help with?
    (I need help making signs isn't very explaining)
     
  3. Offline

    jay275475

    Well I am Making a plugin that joins a world where the Arena Is But I don't know how to do it.
     
  4. Offline

    Datdenkikniet

    lol,I don't get you.
     
  5. Offline

    Retherz_

  6. Offline

    jay275475

    MercilessPvP I was looking at your tutorial.

    But I still wonder how to let a player go to another world

    Code:java
    1. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    2. Player player = (Player) sender;
    3. if(cmd.getName().equalsIgnoreCase("join")){
    4. player.sendMessage(ChatColor.GOLD + "LeagueOfMinecraft" + ChatColor.BLUE + " You Have Joined The Game!");
    5. player.teleport(player.getWorld().getSpawnLocation());
    6. }
    7. return false;
    8. }
    9. }


    I have this What Do I need to Change And Im working on the signs then ill post it to see if Im right

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

    Retherz_

    p.teleport(Bukkit.getWorld("world_name"), x, y, z);
     
  8. Offline

    jay275475

    instead of player.teleport(player.getWorld().getSpawnLocation());?
     
  9. Offline

    Retherz_

    yes, or just p.teleport(Bukkit.getWorld(world name).getSpawnLocation());
     
  10. Offline

    jay275475

    I get this Error
    Code:java
    1. p.teleport(Bukkit.getWorld(getConfig().getString("Map")), getConfig().getString("X"), getConfig().getString("Y"), getConfig().getString("Z"));

    With the Method
     
  11. Offline

    Retherz_

    How is that a Method and how is that an error?
     
  12. Offline

    jay275475

    Ok I think i got it
    Code:java
    1. p.teleport((Location) Bukkit.getWorld(getConfig().getString("Map")).getSpawnLocation());


    It works Now It was Something I did Wrong

    For the Signs Would this Be right?
    Code:java
    1. @EventHandler
    2. public void onSignJoin(PlayerInteractEvent e) {
    3. final Player p = e.getPlayer();
    4.  
    5. if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
    6.  
    7. if (e.getClickedBlock().getState() instanceof Sign) {
    8.  
    9. Sign s = (Sign) e.getClickedBlock().getState();
    10.  
    11. s.update();
    12.  
    13. if (s.getLine(0).contains("[Map]")) {
    14.  
    15. if (s.getLine(1).contains("Archer")) {
    16. [FONT=Consolas][COLOR=#f26100][SIZE=12px]p.teleport((Location) Bukkit.getWorld(getConfig().getString("Map")).getSpawnLocation());[/SIZE][/COLOR][/FONT]
    17.  
    18. }
    19. }, 10L);
    20. }


    p.teleport((Location) Bukkit.getWorld(getConfig().getString("Map")).getSpawnLocation());
    Thats where it it said that random stuff

    final Player p = e.getPlayer(); isnt working
    Whats the player player I need to use for it?
    Player p = e.getPlayer();?

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

    Retherz_

    If final Player p = e.getPlayer(); doesn't work, Player p = e.getPlayer(); won't work
     
  14. Offline

    jay275475

    Then What Should I put it as?
     
  15. Offline

    Retherz_

    link the code
     
  16. Offline

    jay275475

    Here's what I have so Far
    Code:
    @EventHandler
        public void onSignJoin(PlayerInteractEvent e) {
        final Player p = e.getPlayer();
       
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
       
        if (e.getClickedBlock().getState() instanceof Sign) {
       
        Sign s = (Sign) e.getClickedBlock().getState();
       
        s.update();
        if (s.getLine(0).contains("[Map]")) {
        }
        }
        }
        }
     
Thread Status:
Not open for further replies.

Share This Page