-
-
Notifications
You must be signed in to change notification settings - Fork 0
DisplayItem (DI) intercepts chat events from Bukkit and replaces them with a hover-component for the item you are holding using Spigot, sends a courtesy Bukkit notification of the modified chat text (ReplacedChatEvent) to other plugins, and displays its own chat post using a Spigot method.
First, make sure you are typing the correct replacement and that DisplayItem is loaded (The command /direload should work for ops). Ensure you also have permission to replace items in chat (displayitem.replace)
When reading information below about priorities below (LOWEST, LOW, NORMAL, HIGH, HIGHEST), remember that lower priorities get access to messages first and can cancel/modify them before other plugins - and higher plugins get access later and have the "final say" in modifications of the message IF they receive them uncancelled.
Now that that is out of the way, please refer to one of the below sections.
what is probably happening is another plugin you have is intercepting chat before DisplayItem can receive it. You will need to set the chat priority (listenerpriority) configuration to a value that is lower than the plugin that is intercepting chat. Each chat plugin should have their own configuration, but some (eg: some versions of GriefPrevention) are not configurable and do not give DisplayItem any breathing room.
Note: lowering DI's priority may mean that some chat formatting is not applied to DI posts. For best results, set the formatter to a lower priority than DI, but the plugin blocking DI posts to higher - if it is possible.
This usually occurs because another chat plugin has received the courtesy event notification (of chat being modified) by DisplayItem and blocked it, in order to show their own version of chat. This behavior is not affected by priority settings.
To bypass this, you can disable the modified-chat event configuration (set sendmodifiedchatevent to false), which means that DisplayItem will simply replace chat items and display them without further checking.
Note: disabling the modified chat event will make chat formatting dependent on your chat priority settings - if you no longer see messages as formatted properly, follow the steps in the relevant section below. Note: disabling the modified chat event means that some plugins that display secondary messaging (like DiscordSRV) will no longer see DisplayItem posts.
This is most likely because your chat filtering plugin has detected the original Bukkit chat post and the courtesy message from DisplayItem as spam from the same user.
To resolve this, try one of these two things:
- Follow the steps in Section 2 to lower DI's chat priority configuration and change the priority of DI and your filtering plugin so that DI has a lower priority. If this is done, the original (cancelled) event won't be seen by your filtering plugin - only the new one will be seen.
- Set sendmodifiedchatevent to false in the DI config file. This disables the courtesy (secondary) chat event sent by DI
Note: disabling the modified chat event will make chat formatting dependent on your chat priority settings - if you no longer see messages as formatted properly, follow the steps in the relevant section below. Note: disabling the modified chat event means that some plugins that display secondary messaging (like DiscordSRV) will no longer see DisplayItem posts.
This is generally because you are using a third-party chat formatting plugin and that it applies with a higher priority (occurs later) than DisplayItem.
What you can try is to set the chat priority configuration of DisplayItem (listenerpriority) and your formatting plugin so that the formatter is lower than DI, which will allow formatting to occur before DI intercepts the chat event.
However, sometimes (if your formatting plugin blocks the message to display it or combines multiple actions like filtering and formatting into one priority) this can cause issues (from the above sections) since many plugins don't provide any breathing room between formatting and filtering. In this case, you may want to follow the below steps instead to make DI mimic regular chat appearance instead:
- Set DisplayItem to a lower priority configuration than other chat plugins
- Enable the overridechatformat configuration setting in the DI config file.
- Set the format configuration setting to how you want chat to look.
Note: override chat formatting may not support group prefixes or dynamic elements from other plugins.