Global Chat Mute

Discussion in 'Spigot Plugin Development' started by IllegalSloth, Apr 17, 2017.

  1. Hey, I want to make a global chat mute plugin. I've got my permissions class setup, how would i start coding the GlobalChatMute?

    Basically, all the "Default" players will not be able to talk during this time

    - /chat mute (toggles the chat)

    ~Illegal
     
  2. Save the muted players in a collection, for example in a "HashSet".
    Listen for the AsyncPlayerChatEvent, if that collection (the HashSet) contains the event's sender, cancel the event.
     
  3. Mas

    Mas

    A better way would just be to listen for AsyncPlayerChatEvent and just see if the player trying to chat has the permission. No need to store anything other than the 'muted' boolean in this case.