Pl3xMOTD
Description
Pl3xMOTD is a simple and small plugin that allows administrators to change their server's MOTD message and server-icon on the server list without restarting the server.
Fully Supports: color codes, multiple lines (in CB1.7.2+), random messages, random icons, and variables! Theres even an added color code to get a random color! Just use &x for a random color per motd ping.
Enjoy! ^_^
Custom server-icon.png
To use the custom server-icon feature you must create a new directory at "/plugins/Pl3xMOTD/server-icon/" and place your PNG file(s) here for the plugin to automatically use them. If more than one PNG file is in this directory one will be picked at random each time the server is pinged. The PNG files can be named anything and are not restricted to the "server-icon.png" file-name format.
Please be sure to use the correct standards for your PNG images (64x64 PNG). I have not tested non-standard images, but I'd assume only the top 64x64 portion of the PNG will be shown and anything not a PNG will not load at all.
To disable the server-icon feature just delete or rename "/plugins/Pl3xMOTD/server-icon/" and the default server-icon.png in the root directory will be used like normal.
Variables
You can use any of the following variables in your MOTD messages:
- {playerip} shows the player's IP address
- {playeruuid} shows the player's UUID
- {playername} shows the player's last known name
- {playerdisplayname} shows the player's last known display name (this will be just name if no display name was set)
- {version} shows the server version number
- {lastplayername} shows the name of the last player to join the server (displays "n/a" if no last player this boot)
- {lastplayerdisplayname} shows the display name of the last player to join the server
- {lastplayeruuid} shows the uuid of the last player to join the server
Default config.yml
Version 2.0
1 2 3 4 5 | # Enable debug info in console debug-mode: false # Enable colors in console output color-logs: true |
Default motds.yml
Version 2.0
1 2 3 4 | motds: - '&c{playername}, join us!\n&6We have cookies! &e:O' - '&eUUID&7: &b{playeruuid}\n&eServer Version&7: &b{version}' - '&bDisplayName&e: &7{playerdisplayname} &bName&e: &7{playername}\n&bIP&e: &7{playerip}' |
Commands
- /pl3xmotd (reload) View plugin version and/or reload config.yml from disk (Aliases: changemotd, servermotd, motd)
- /pl3xmotd (set) Replace all MOTD messages with a new one
- /pl3xmotd (add) Add a new MOTD to the current list
- /pl3xmotd (remove) Remove a MOTD from the list (you must type it exactly as it is in the motds.yml file)
- /pl3xmotd (clear) Clears all MOTDs from the file and reverts back to using the server.properties MOTD
Permissions
- pl3xmotd.command.pl3xmotd Allows access to the /pl3xmotd command
TODO
Multiple MOTDs cycled through randomlyAdded in v1.2Add ability to change the server-icon.png on the flyAdded in v1.3Add "motd" as a short aliasAdded in v1.3Add support for player names in MOTDAdded in v2.0Add commands to set MOTD in-gameAdded in v2.0
Suggestions? Leave a comment!
Metrics
This plugin uses metrics to collect stats! It only collect basic things such as version type, and players online. If you want to see everything, click on the graph. Go into /plugins/PluginMetrics/config.yml to disable stat collecting if you wish.
@walster001
This works fine on Spigot 1.8.8 - That's the version my server runs. Is there anything specific that makes you believe otherwise? Any errors/issues you want to report?
@CloudeLecaw
It indeed is a nice database, however a command/feature like that is beyond the scope of this project.
Psst, This isn't currently working on Spigot 1.8.8 Is much required to update to it?
@BillyGalbreath
Can you make it so when you hover over the player count you can see a message there?
@BillyGalbreath
thx!
@supabro
The same way you would by setting it in the server.properties file. Text that wont fit on one line (too long) will wrap around to the second line automatically. If you want to force your way to the 2nd line just use the escaped newline character \n as seen in the default config file. ;)
How to i make a motd with 2 lines at the same time while showing?
looks awesome! trying it out!
@RealRunSpace
I can, and I plan to for the next major release (v3.0). Its still a ways out because its extremely experimental stuff. The way it works is it send the MOTD ping to the client repeatedly, changing it very slightly to make it appear as frames of an animation. This is done by tricking the client into leaving the MOTDPing connection open, which may lead to problems down the road. I am experimenting with the idea of it, though. ;)
@ThisUsernameIsMine
Hmm. I'll check that out and see what;s going on there.
@BillyGalbreath
With the new version, {playerdisplayname} still shows regular names for people who connect using a nickname.
I also don't see it update the displayname values in playerData.yml
edit: {lastplayerdisplayname} on the other hand seems to function correctly
Suggestion: Make the motd as the MinePlex oficial Server,that motd can move,and make the photo move too.Can you?
Updated to v2.2
Fixes:
Compatible with Spigot's 1.8 builds of CraftBukkit and Spigot.
@ThisUsernameIsMine
I'm not sure how Essentials is using nicknames, but I can assure you my plugin is retrieving the display name from the Bukkit Player object. Works fine with my private commands plugin's and RoyalCommand's /nick command. That's definitely a weird one. I'll look more into it soon.
As for linking the icon to a specific motd, thats going to change the entire core of the plugin. Especially the config. I do like the idea, though, and will definitely be adding it in v3.0. It will be awhile before that, though, as there is a huge plugin I am currently working on that eats up most of my time (Pl3xCities). You had good timing with your post earlier today because I had just got off work early for the day ^_^
@BillyGalbreath
Lol.. That was somewhat unexpected! :-)
A small remark though:
I use Essentials(Chat) and changed my nickname, but {playerdisplayname} and {lastplayerdisplayname} still show my regular name (even after relogging). As if the values aren't updated (i'm running git-Spigot-d0d1d87-bc03b6f).
Random colors work fine ;-)
And (last but not least), i have another suggestion for your plugin:
- Possibility to link server-icons to a specific MOTD (more personalised MOTD's)
Uploaded v2.1
Added:
Compatible with Spigot's 1.8 builds of CraftBukkit and Spigot.
This should be approved shortly. ^_^
As i did almost 2 months ago..
Add a variable that changes the MOTD's color on each server ping/refresh i.e. random-color variable.
Suggestion: add a variable to show most-recent player's (display)name who joined the server.
Thanks :-)
Updated to v2.0
Added:
Changed:
Compatible with Spigot's 1.8 builds of CraftBukkit and Spigot.
@Marium0505
Not sure what all the fuss was about with \n vs /n as the \n character does indeed work fine.However, /n is not a valid character and will not break the line.
@valiobg
You can open the jar file with WinRar (or equivalent) and edit the plugin.yml file directly to change the aliases. ;)
I am taking this plugin back, and will be updating it to MC1.8 in the next few days with the TODO list above finished.