An API for consistent plugin messages across your server!
pMessage allows you, the server owner, to have all of your installed plugins send players messages with the same formatting. This makes your server look more professional as all plugins have the same format, layout and style.
Discord: https://discord.gg/011Ko7udD8zmZt8JN
Consistent plugin messages across your server!
Customisable message formats!
Custom error, success and information colours!
Custom 'no permission' and 'must be player' messages!
/pmessage - This is the main (and only) command for the plugin.
/pmessage reload - Reloads the configuration file.
pmessage.reload - Access to /pmessage reload.
Using pMessage is simple.
-
Add pMessage to your project in your IDE just like your Spigot/Craftbukkit jar. For example, in Eclipse, you add it as an External Library in your project's Build Path.
-
Create an instance of the Messenger class in your plugin's main class:
Code (Text):Messenger msg;
public void onEnable(){
if(getServer().getPluginManager().isPluginEnabled("pMessage"))
msg = new Messenger(this);
} -
Call any of the below methods when you want to send a message. The 'receiver' argument for all the methods takes a CommandSender, so you can pass the console or a player.
-
Add pMessages as a dependency in your plugin.yml.
Methods
Code (Text):
msg.needPermission(CommandSender receiver);
Code (Text):
msg.needPlayer(CommandSender receiver);
Code (Text):
msg.error(CommandSender receiver, String message);
Code (Text):
msg.success(CommandSender receiver, String message);
Code (Text):
msg.info(CommandSender receiver, String message);
Code (Text):
msg.msg(CommandSender receiver, String message, ChatColor colour);
Variables
Code (Text):
msg.ERROR_COLOR;
Code (Text):
msg.INFO_COLOR;
Code (Text):
msg.SUCCESS_COLOR;
![[IMG]](http://proxy.spigotmc.org/512e8ee214bbacb0227ffc07defcbe4bd0bb091a?url=http%3A%2F%2Fi1279.photobucket.com%2Falbums%2Fy523%2Ftextcraft%2FAug%25202014%2520-%25202%2F7f8f8c3232f74b12149059796a12093ab3444467da39a3ee5e6b4b0d3255bfef95601890afd80709da39a3ee5e6b4b0d3255bfef95601890afd80709648d6f0a39cae8175ac3_zps21eb7397.png)
This section is for server owners. If you are a developer looking to use pMessage in your plugin then please see the API Usage section above.
The configuration file allows you to tweak how plugin messages will look.
For 'success', 'error' and 'info' the values can be any colour code in name form. For a list of accepted colours, go to this link and use values under the 'Technical Name' column.
'format' - This is the overall format of a message. This can be whatever, but is must contain '%plugin%' and '%message%' (without quotation marks). '%plugin%' will be replaced with the name of the plugin sending the message, and '%message%' will be replaced with the message itself. You should always have &r before %message% as this allows the message colours to not glitch.
'success' - This is the chat colour of all messages that plugins define as success messages. The default colour is green.
'error' - This is the chat colour of all messages that plugins define as error messages. The default colour is red.
'info' - This is the chat colour of all messages that plugins define as informative messages. The default colour is gold.
'no-permission' - This is the message sent when a plugin wants to inform the player that they do not have permission. This value will be used in the 'format' set above, replacing '%message%'.
'no-player' - This is the message sent when a plugin wants to inform the console that only players can execute a command. This value will be used in the 'format' set above, replacing '%message%'.
![[IMG]](http://proxy.spigotmc.org/621d2cb9b63959cbfa987f5e11d64d0bf793601b?url=http%3A%2F%2Fi1279.photobucket.com%2Falbums%2Fy523%2Ftextcraft%2FAug%25202014%2520-%25202%2F5ab9b81f3af95559f1f644cd891606ac499ec737da39a3ee5e6b4b0d3255bfef95601890afd80709da39a3ee5e6b4b0d3255bfef95601890afd8070963342796542429a2eb26_zps02e7dd74.png)
Just drag and drop the pMessage.jar into your /plugins folder. Then restart or reload your server and you're good to go!
Please note that this plugin will not do much by itself. This is primarily an API, and so it will not need to be used unless other plugins use it.
Also, not all plugins use pMessage, so not all plugin messages will be formatted by pMessage. Only plugins that support it will be formatted.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.9
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
pMessage is a free Minecraft Java mod. Compatible with Minecraft 1.9. Downloaded 33,080 times (via Spigot). Download it and open it directly in the game.