Chat Event not working :(

Discussion in 'Spigot Plugin Help' started by Eros, Oct 12, 2019.

  1. Why this is not working?

    @EventHandler
    public void onPlayerChat1(final AsyncPlayerChatEvent event) {
    Player player = event.getPlayer();
    Profile profile = new Profile(player.getUniqueId());
    if (!profile.hasGlobalChat()) {
    event.getRecipients().remove(player);
    }
    }
     
  2. please help me i need asap :(
     
  3. You don't need final, and let me see your main class. Any errors?
     
  4. Strahan

    Benefactor

    Also the name of the method implies you possibly have another AsyncPlayerChatEvent method in that class? If so, don't do that.