Solved Events not respeted?

Discussion in 'Plugin Help/Development/Requests' started by Sarcry, Sep 2, 2016.

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

    Sarcry

    I'm getting some problems with events when I want to cancel them. I get the same error with BlockBreakEvent too. Here's the code:
    Code:
    public class GlobalChatListener implements Listener {
        private Punish plugin;
    
        public GlobalChatListener(Punish plugin) {
            this.plugin = plugin;
    
        }
        @EventHandler(priority = EventPriority.HIGH)
        public void PlayerChatEvent(AsyncPlayerChatEvent e) {
         
            Player player = e.getPlayer();
         
            if (this.plugin.muteGlobal = true) {
                e.setCancelled(true);
                player.sendMessage(ChatColor.RED + "Global Chat is currently disabled!");
            }
        }
    }
    
    The muteGlobal is a public boolean that equals false(on main class)

    HAS BEEN SOLVED: forgot to registerEvents xD
     
    Last edited: Sep 2, 2016
Thread Status:
Not open for further replies.

Share This Page