Solved sign.setLine();

Discussion in 'Plugin Development' started by envic, Jul 10, 2016.

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

    envic

    Hey guys,
    This an other problem i faced to it!

    Code:
    @EventHandler
        public void onPlayerInteract(PlayerInteractEvent e) {
            if (!(e.getAction() == Action.RIGHT_CLICK_BLOCK))
                return;
            if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
                if (e.getClickedBlock().getState() instanceof Sign) {
                    Sign sign = (Sign) e.getClickedBlock().getState();
                    if (sign.getLine(0).equalsIgnoreCase("§6[§5BattleLeague§6]")) {
                        main.getInstance().checkLobbyAndSend(e.getPlayer());
                        sign.setLine(1, "§a<" + ChatColor.AQUA + main.getInstance().pInLobbyCount() + "§a/4>");
                    }
                }
            }
        }
    When a player interact the sing!,
    no line set to string i want! even
    Code:
    sign.setLine (1, "test");
     
  2. Offline

    N00BHUN73R

    @envic
    Are your events registered? Add some debug lines to see where it gets to.
     
  3. sign.update() after setting the lines
     
  4. Offline

    envic

    Thanks;

    Solved!
     
Thread Status:
Not open for further replies.

Share This Page