Skip to content

Announcements


Announcements Configuration

The announcement system in Cobblemon BattleHUB allows you to display news, important notices, and links directly in the mod menus (GUI) for players. It uses the modern MiniMessage text format, supporting colors, gradients, and even clickable links that open a browser.


File Path

config/cobblemon_battlehub/announcements.json

Default Configuration Template

Below is the official template automatically generated by the AnnouncementsManager class:

{
  "version": 1,
  "mensagens": [
    "<gradient:gold:yellow><bold>[NEWS]</bold></gradient> <white> Season 1 has started!</white>",
    "<click:open_url:'https://discord.gg/GbbbNvQG3N'><aqua><u>Join our Discord!</u></aqua></click>"
  ]
}

The array key is mensagens, not messages

The message list key in announcements.json is spelled mensagens (Portuguese). If you rename it to messages the mod will load zero announcements. Keep the key exactly as generated.


Detailed Parameter Explanation

1. Notification Control (version)

  • version (Default: 1): This integer is the "unread" tracker. Each client stores the last version it has seen in config/cobblemon_battlehub/announcements_state.txt. When you edit announcements.json and raise the version number (e.g. 1 → 2), every player gets a New / unread badge on the announcements panel until they open it. If you edit the text but leave the version unchanged, players who already read it won't be re-notified.

2. Visual Content (mensagens)

  • mensagens (string array): The announcement lines shown in the player's interface, top to bottom. Add as many as you like. Each line is parsed with MiniMessage (Kyori).

How to Style and Create Great Announcements

The mod interprets MiniMessage syntax, so you do not need to rely on legacy Minecraft color codes like &a or &c. Here are some supported formatting options:

1. Colors and Gradients

  • Simple Colors: Use <red>, <blue>, <green>, <gold>, etc.
    • Example: <green>New update available!</green>
  • Gradients: Create smooth color transitions using <gradient:color1:color2>.
    • Example: <gradient:gold:yellow><bold>[UPDATE]</bold></gradient>

2. Text Formatting

  • Bold: <bold> or <b>
  • Underline: <underline> or <u>
  • Italic: <italic> or <i>

You can make text open the player's browser when clicked:

  • Link Syntax: <click:open_url:'LINK'>Clickable Text</click>
    • Practical Example: <click:open_url:'https://discord.gg/GbbbNvQG3N'><aqua><u>Click here to join Discord!</u></aqua></click>

What actually renders

Announcement lines are converted to Minecraft's classic text format, so colors, gradients, and the bold / underline / italic decorations work, and <click:open_url:'...'> is supported as a special case. Other MiniMessage tags — <hover>, <click:run_command>, <click:suggest_command>, <insert>, <font> — are not applied. Use single quotes around the URL ('...'); double quotes also work but pick one and don't mix them in the same tag.


How to Reload New Messages

After changing the messages or increasing the version in announcements.json, apply the update immediately on the server and sync the UI for all online players by running:

/bh reload