Solved Sign update event doing nothing

Discussion in 'Spigot Plugin Development' started by JustWessol, May 28, 2017.

  1. hello, i was testing the sign change event but it doesn't work and it doesn't give errors
    Code (Text):

    public class Main extends JavaPlugin implements Listener {
       
        @Override
        public void onEnable(){
               
               Bukkit.getServer().getPluginManager().registerEvents(this, this);
        }
        @Override
        public void onDisable(){
           
        }
       
        public void onSign(SignChangeEvent e){
            if(e.getLine(0).equalsIgnoreCase("[Zombies]")){
                e.setLine(0, ChatColor.BLACK +  "Zombies");
            }

        }

    }
     
    that is the whole class
    can anyone help me pls?
     
  2. Code (Text):
        public void onSign(SignChangeEvent e){
            if(e.getLine(0).equalsIgnoreCase("[Zombies]")){
                e.setLine(0, ChatColor.BLACK +  "Zombies");
            }

        }
    Change it to
    Code (Text):
    @EventHandler
      public void onSign(SignChangeEvent e){
            if(e.getLine(0).equalsIgnoreCase("[Zombies]")){
                e.setLine(0, ChatColor.BLACK +  "Zombies");
            }

        }
    You just forgot your @EventHandler
     
    • Agree Agree x 1
  3. my bad, Just going to get my glasses from downstairs