Skip to main content

FancyMessage Configuration

This Document outlines what and how FancyMessage is, and how it works on AnubisMC for Managers.

Outline

The Short Version: When you configure a message to look pretty, you’re using FancyMessage

The Long Version: FancyMessage is an abstraction ontop of the RGB library we use for development of plugins on AnubisMC. The name stems from it… being fancy! It allows for the configurator of the plugin to choose a few important properties about messages:

  • If it is a Chat Message
  • If it is an ActionBar Message
  • If it is a Title Message (optionally with a subtitle)
  • If it has a sound

Or if you’re really crazy, all of them at once!

FancyMessage actually stems all the way back to June 2020 and was developed by a developer called Phil. It has provided an incredibly robust system since then as it works with the Adventure API across Paper, Fabric, Sponge and Forge.

Default Configuration

A default configuration for a FancyMessage will normally just include a Chat Message, for example:

{
"trivia-started-max-questions": {
"message": [
"<symbol:tick> <col:success>A trivia session of <questions> questions has been started. Have fun!"
]
}
}

Taken from a Pixelmon 1.16 implementation of Trivia

This would simply display in chat the following message:

Example

Nice and simple! (we will get to those special tags in a little while)

Additional Configuration Nodes

A fully expanded FancyMessage which sends a chat, actionbar, title, subtitle and sound would look like:

{
"trivia-started-max-questions": {
"message": [
"<symbol:tick> <col:success>A trivia session of <questions> questions has been started. Have fun!"
],
"actionbar": "<col:success>A trivia session of <questions> questions has been started. Have fun!",
"title-title": "<col:trivia><sc>TRIVIA",
"title-subtitle": "<col:success>A trivia session of <questions> questions has been started!",
"sound": "music_disc.13",
"soundsource": "MUSIC",
}
}

For reference, this would play Music Disc 13 to the client.

And that’s all you need to know about FancyMessage! Just note that the message node is actually a List of strings, so you can implement multi-line messages here.

All of these (including translatable texts) can be done via our backing message implementation - MiniMessage. Please view their documentation here [NOT here). They are very extensive but should you get stuck please speak to a developer.

Custom Tags in FancyMessage/Configurations

We do have some custom tags in our implementation of FancyMessage to make configurations easier.

Under /canvas/pixelmoncore/minimessageconfig.json It is split into three main sections;

resource-pack-icons, custom-colors and symbol-icons. This is a simple translation map which allows you to define RP icons, custom colors or symbols to use across all Pixelmon-based configs. For example:

If you had the following custom-colors configuration:

{
"custom-colors": {
"h1": "#3DC3EE",
"h2": "#e5c890",
"text": "#EA80EC",
"subtext": "#D7B7D8"
}
}

The colours can be used in all plugins via the col tag, for example (from PokeParty):

{
"starting-message": {
"message": [
" ",
" <symbol:star><symbol:star> <symbol:pokeparty> <col:h2><sc>STARTING SOON</sc> <symbol:star><symbol:star>",
" ",
" <col:text>All online players will recieve a",
" <col:reward>Random Shiny <col:text>in <col:time><time></col:time>!",
" <col:h2><sc>Host: <host></sc>",
" ",
" <symbol:star><symbol:star> <symbol:pokeparty> <col:h2><sc>STARTING SOON</sc> <symbol:star><symbol:star>",
" "
]
}
}

This can be used to create a fully uniform server styling as we progressively rewrite more content, meaning the entire palette can be switched out in one configuration for a different realms’ colors. This reduces time wasted setting up resets and provide a slightly differentiated view for the players.

Tags Available

  • col - custom-colors (<col:h1>Some Text!)
  • symbol - symbol-icons (<symbol:star>)
  • rp - resource-pack-icons (<rp:logo>)
  • sc and smallcaps - smallcaps (<sc>Some Text!</sc> - will return sᴏᴍᴇ ᴛᴇxᴛ!)

Where possible all rp unicode symbols should be defined in here to reduce the amount of copy-paste needed from the default.json file in the RP, as means a lot less compared to <rp:cool_emote>