Trade Notifications - Shopkeepers/Shopkeepers-Wiki GitHub Wiki
There are two types of trade notifications:
- Notifications for shop owners about trades that take place in their own shops
- General trade notifications for all players with certain permission nodes
In order to avoid that a player receives two notifications for the same trade, the shop owner notifications take precedence over the general trade notifications if both types of notifications are enabled.
Shop Owner Trade Notifications
These notifications can be enabled inside the config with the setting notify-shop-owners-about-trades
(default: enabled).
An option inside the shopkeeper editor allows shop owners to disable the trade notifications for specific shopkeepers. This option is only available for player shops and only affects the trade notifications that are sent to the shop owner, not the general trade notifications that may be sent to other players.
General Trade Notifications
These notifications can be enabled with the setting notify-players-about-trades
(default: disabled) inside the config. When enabled, trade notifications are sent to all online players with certain permissions:
shopkeeper.trade-notifications.admin
(default:false
): Players with this permission receive notifications for all trades that take place in admin shops.shopkeeper.trade-notifications.player
(default:false
): Players with this permission receive notifications for all trades that take place in player shops.
Customization
The trade notification messages can be changed by creating a custom language file. See Language Files on how to do that. There are different sets of trade notification messages for different trade variations and contexts. The default messages do not make use of all of these variations, but this should provide a lot of flexibility when adjusting the messages.
Additionally, the config settings trade-notification-sound
(disabled by default) and shop-owner-trade-notification-sound
allow the setup of sound effects that are played whenever a trade notification is received. These sound effects can be disabled by setting these settings to an empty String inside the config.
Avoiding Spam
In order to avoid notification spam, the notifications for equal trades that take place in quick succession over a few seconds are merged into a single notification. A side effect of this is that notifications may be sent several seconds after the trade took actually place.
However, this does not completely prevent players from potentially causing spam by trading. If this is a concern to you, you may have to disable the trade notifications for now, until more sophisticated countermeasures are available to guard against spam.
Players can also disable trade notifications with the command /shopkeeper notify trades
(see Commands). The first trade notification received during the current game session informs the player about this command. This hint message is clickable and will automatically insert the command to execute into the player's chat box. This hint is only sent to players that have the permission to use the command (see Permissions).
However, since the plugin does not yet keep track of any user-specific data, the trade notifications are currently only disabled for the current game session, i.e. until the player reconnects.
Future Improvements
There are several things to look into in the future:
- Notifications about the shop being out of stock: https://github.com/Shopkeepers/Shopkeepers/issues/746
- Notifications about the chest being full: https://github.com/Shopkeepers/Shopkeepers/issues/746
- Better protection against players causing notification spam: https://github.com/Shopkeepers/Shopkeepers/issues/748
- Storing notifications while the player is offline: https://github.com/Shopkeepers/Shopkeepers/issues/749
- Remembering the selected notification state of players: https://github.com/Shopkeepers/Shopkeepers/issues/747
- Logging trades to the console: https://github.com/Shopkeepers/Shopkeepers/issues/750
- Propagating trade notifications to players on other servers within a BungeeCord network.