Skip to content

Listener Priorities

Matej edited this page Jul 16, 2024 · 5 revisions

To prevent conflicts with other chat plugins, Bukkit came up with a priority system for plugins listening on the same event.

Plugins listening to chat at lowest priority come first. They can change the recipients, the message, or even cancel the chat sending.

Then, a plugin with higher priority can change it back, or even un-cancel it. There are six priorities in Bukkit that are called in the following order:

  1. LOWEST
  2. LOW
  3. NORMAL
  4. HIGH
  5. HIGHEST
  6. MONITOR

Example how priorities work:

If we have three plugins enabled; one is a basic area protection plugin, one is a fancy plugin using signs, and another is a logging plugin. The protection plugin listens on Priority.LOWEST. It says they can't place blocks in this area, and cancels the event.

The fancy sign plugin listens on Priority.NORMAL. It says they can place signs here, and uncancels the event. The log plugin listens on Priority.MONITOR. It sees that the event was actually allowed, and logs it.

Remember, as a general rule of thumb, ChatControl need to come FIRST (meaning lowest priority and old chat event) to edit and cancel the message. If the other plugin comes before us (such as DiscordSRV) it will still send your message to your Discord even if ChatControl cancels it. To fix this, you need to play with this option, as well as play with different priorities. Congratulations to Paper team for wasting your time :/

#f03c15 NB: You must restart the server after changing the priority to take changes! #f03c15

Towny / Factions / Plots Squared

For the most servers, you will need to experiment with the values to find a suitable combination that works for you. One user has reported following configuration working well with FactionsChat:

Chat_Listener_Priority: LOWEST

Punishment plugins, for example: LiteBans

If players can speak even when muted, it means that ChatControl listens to the chat event before the plugin that mutes your players, and thus allow them to speak anyway.

Users have reported that changing the Formatter priority to HIGH have fixed the issue.

You may experiment with different values (LOWEST, LOW, NORMAL, HIGH, HIGHEST and also MONITOR) to find a combination that works with your other plugins.

Denizen

Use the following settings to allow the Citizens2-Addon Denizen to catch chat-triggers for its scripts.

Chat_Listener_Priority: HIGH
Clone this wiki locally