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
Current code: main.java = https://hastebin.com/jarosutude.scala permissions.java = https://hastebin.com/zanuvidemo.java
Cancel this event: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/AsyncPlayerChatEvent.html
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.
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.