-
Notifications
You must be signed in to change notification settings - Fork 8
Listener Priorities
Every plugin gets a say in what happens, and every plugin must get a chance to know the outcome of an event. So, we pass events to plugins even after they've been cancelled. A plugin can actually uncancel an event after another plugin cancelled it. This is where priorities become really important.
There are six priorities in Bukkit that are called in the following order
- LOWEST
- LOW
- NORMAL
- HIGH
- HIGHEST
- MONITOR
Let's say a BLOCK_PLACE event is being handled. The lowest priority listener is called to get its say in whether it should be cancelled or not. Then the low priority listener is called to see if it wants to override the lowest, etc. Eventually it hits monitor, and at this point nothing should change the outcome of the event. Monitor should be used to see the outcome of an event, without changing any aspect of it.
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.
Source:
Event API Reference, fetched 09.04.2017 from http://bukkit.gamepedia.com/Event_API_Reference#Event_Priorities
Common issues involve that ChatControl modifies the chat before the other plugin, or after that, causing the wrong order. You can edit the priorities in ChatControl manually and find a suitable combination.
There are two priorities you can change. Both of them are found in the Listener_Priority section in settings.yml
- Listener_Priority.Formatter (Used for chat formatter and channels.)
- Listener_Priority.Checker (Used for antispam, anticaps, rules etc.)
- Listener_Priority.Signs (Used for rules on signs.)
NB: You must restart the server after changing the priority to take changes!
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
:
Listener_Priority:
Formatter: LOWEST
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.
Use the following settings to allow the Citizens2-Addon Denizen to catch chat-triggers for its scripts.
Listener_Priority:
Formatter: HIGH
© MineAcademy | Code Unique Minecraft Plugins & Servers In 20 Days
About
Free version
Basics
Understanding
- Channels
- Formatting
- Rules / Filters
- Handlers
- Groups
- JSON
- Discord
- Toggle ignoring swears
- Variables
- JavaScript Variables
Tweaking
Solving Issues
Miscellaneous