Wiki 9Minecraft Wiki 9Minecraft

Adding Colors and Placeholders to Mod Messages

Message-api reads every message through PlaceholderAPI. This means the text in a mod's language file can include colors and placeholders, not just plain words. Use it to match a mod's messages to your server's style.

Before you start

  • Make sure PlaceholderAPI is installed on the server next to Message-api. It is required, and it is what turns your formatting into colored text.
  • Find the message file at ./config/<modid>/<languageid>.json, for example en_us.json.

Styling a message

1. Open the language file in a plain text editor and find the message you want to change.

2. Edit only the text value, never the message id.

3. Add color and formatting using the text format PlaceholderAPI understands. Message-api passes your text straight to PlaceholderAPI, so check PlaceholderAPI's own formatting reference for the exact syntax.

4. Add placeholders the same way, also using PlaceholderAPI's syntax. They are filled in when the message is sent.

5. Keep the whole value inside its quotation marks so the JSON stays valid.

6. Save, restart the server, and trigger the message to see the result.

Tips

  • Change one message at a time and test it. That way, if formatting shows up as raw text, you know exactly which edit caused it.
  • If a message appears with its formatting printed literally, recheck the syntax against PlaceholderAPI's documentation.
  • Players see the styled result in normal chat. They need nothing extra on their own clients, because Message-api runs on the server only.
Join 9Minecraft News & Guides