Minecraft Random MOTD Selector

A fun micro-project, this Powershell script will select a random message of the day (MOTD) and write it to disk. Being an addition to the MC process monitoring script the scipt runs everytime the server restarts (Every 12 hours), also is engaging for the community to submit phrases and see their submissions displayed.

Below is the script, personally I placed it within a function and called it when required. Its pretty self-explanatory, I would like to mention more time was spent diagnosing why MC would have a fit and corrupt the file. Then I noticed the server.properties file was not being encoded in UTF-8, once amended it worked flawlessly.

The script also allows specific date overrides, which could be used for holidays and server related events.

MOTD.txt is used to store the MOTD’s, which are separated by a new line.

ColourChart.txt contains the MOTD colours which are randomly selected and applied to the text.

Posted in Powershell and tagged , .