MOTD Decorators

Decorators API introduction

In RealMotd 0.9, MOTD decorators have been added to the game. Decorators allow users to choose how colors, formatting and maybe other cool things will be added to their MOTDs. User can then choose which decorators they want to use. Each decorator has its advantages and disadvantages, which is why you can choose which one to use.

For admins

In plugins/RealMotd/config.yml , there's a config file for RealMotd. This config file contains a list called 'decorators'. You can add your decorators to this list. Order of applying decorators is the same as you specify in config file. Currently, these are available decorators:

  • color_names
  • color_chars
  • custom_formatting
  • rainbow

color_names decorator

This decorator adds colors to your MOTD, using longer names of colors. You type '&' and then name of color you want to use like this:

&aqua

Available colors

  • black
  • dark_blue
  • dark_green
  • dark_aqua
  • dark_red
  • dark_purple
  • gold
  • gray
  • dark_gray
  • blue
  • green
  • aqua
  • red
  • light_purple
  • yellow
  • white

This decorator also provides formatting constants you can use the same way:

  • bold
  • strikethrough
  • underline
  • reset
  • magic

If you understand Java, you might want to know that this works with bukkit's ChatColor enum, so you can see up-to-date list of constants on this page: http://jd.bukkit.org/rb/apidocs/org/bukkit/ChatColor.html

color_chars decorator

As not everyone likes to type &aqua, you may want to type &0,&a,&f etc. instead. If you like these codes more, you can use color_chars decorator. It looks for color codes above and changes them to raw color code. For complete list of color codes, visit this page: http://minecraft.gamepedia.com/Formatting_codes . There's a code column, which says for example '§a'. To get that color, you need to type '&a'.

custom_formatting decorator

This decorator adds formatting codes &bo, &str, &ran, &it, &un, &no. I know color decorators above already contain these, but the names are either too long or they lack description. If you want to have readable motd.txt, I recommend you use these shortcuts.

  • bo = bold
  • ran = write a random string (used in one of the splashes)
  • str = strike
  • it = itallics
  • un = underline
  • no = remove formatting(except colors)

rainbow decorator

Rainbow decorator creates rainbow in your MOTD and by rainbow I mean that every letter after this up the reset formatting char will be colored randomly. You can choose which colors to use in your configuration file. To use rainbow in MOTD, type &rbow and you can end it with remove formatting character.

Colors & Formatting

If you want to use colors & formatting at once, remember that order matters. Color constant(e.g. &aqua) always has to be before formatting constant(e.g. &bo) or you'll get rid of formatting. So to get bold text of aqua color, you can't use

&bo&aqua

. Instead, you have to use

&aqua&bo

to get the expected result. This is caused by minecraft client and I have no idea why it works this way :)

Recommended decorator order

Decorators can sometimes be crazy, which is why I'm providing this section aswell. It's recommended to firstly decorate colors, so in the list in config file, your first decorator should be either color_names or color_chars. Then, you should apply custom_formatting if you want to use it and rainbow at the end. After this, you can add your own decorators, which need to be programmed in Java...


Comments

Posts Quoted:
Reply
Clear All Quotes