Plugin Help Can you Read Signs?

Discussion in 'Plugin Help/Development/Requests' started by BestMcPlayers, Apr 18, 2015.

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

    BestMcPlayers

    I plan on making a huge Minecraft server. I've made plenty of cool custom games so far. I plan on going big, but one thing. I don't have a lobby.

    I want a lobby that you can use signs to join games. Can I use signs like this?

    if (sign1.line1.equals("Hungergames") && sign1.isClicked && more stuff)
    {
    Go to server blah blah blah
    }
     
  2. Offline

    Yaron_1231

    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent e){
    if(!(e.getAction()==Action.RIGHT_CLICK_BLOCK)) return;
    if(e.getClickedBlock().getState() instanceof Sign){
    Sign s=(Sign) e.getClickedBlock().getState();
    if(s.getLine(0).equalsIgnoreCase("check for lines")){
    //Teleport to a game and do other stuff.
    }
    }
    }
     
    BestMcPlayers likes this.
  3. Offline

    pie_flavor

    @Yaron_1231 Tip: Encase your code with [code=java][/code] so it looks like code, and also so the forums doesn't remove the tab breaks / spaces.
    Tip: x!=y is the same as !(x==y)
    Tip: instanceof doesn't always work, that's what getType() is for.
     
  4. Offline

    Yaron_1231

    Thanks ill use it more (the getType() and the code=java /code)
     
  5. Offline

    BestMcPlayers

    You the man, thanks. Works like a charm. Requesting this locked.
     
Thread Status:
Not open for further replies.

Share This Page