that doesn't strip the color off the sign, so the SignClickEvent doesn't actavate if (sign.getLine(0).equalsIgnoreCase(ChatColor.stripColor("[Rank]"))) { thats the line that doesnt work but i posted full coding of the events below Code: } @EventHandler public void block(SignChangeEvent e) { Player player = e.getPlayer(); if (player.hasPermission("Ranks.Sign") && e.getLine(0).equalsIgnoreCase("Test")) { e.setLine(0, "§1[Rank]"); e.setLine(1, "Test"); } else { } } @EventHandler public void interactSign(PlayerInteractEvent e) { Player p = e.getPlayer(); PlayerInventory pi= p.getInventory(); ItemStack iih = p.getInventory().getItemInHand(); if (e.getAction() != Action.RIGHT_CLICK_BLOCK) { return; } if (!(e.getClickedBlock().getState() instanceof Sign)) { return; } Sign sign = (Sign) e.getClickedBlock().getState(); if (sign.getLine(0).equalsIgnoreCase(ChatColor.stripColor("[Rank]"))) { p.sendMessage("§cTest"); } }
KoolzSkillz Your stripping the color from the String "[Rank]" which has no color. Try using it on the signs first line instead.
Skionz i dont understand where to put the strip color, it doesnt work like that Code: if (ChatColor.stripColor(sign.getLine(0).equalsIgnoreCase("[Rank]") && sign.getLine(1).equalsIgnoreCase("VIP"))) {
KoolzSkillz ChatColor.stripColor(...) returns a String, that String should be what you're invoking equalsIgnoreCase(...) on.
You misplaced brackets: Code:java if (ChatColor.stripColor(sign.getLine(0).equalsIgnoreCase("[Rank]") && sign.getLine(1).equalsIgnoreCase("VIP"))) { Has to be Code:java if (ChatColor.stripColor(sign.getLine(0)).equalsIgnoreCase("[Rank]") && sign.getLine(1).equalsIgnoreCase("VIP")) {