Configuration

This guide covers all configuration options available in AnnouncementGUI.

📁 Configuration Files

AnnouncementGUI uses several configuration files:

  • config.yml - Main plugin configuration

  • gui-messages.yml - GUI messages and prompts

  • guis/*.yml - GUI layout configurations

🔧 Main Configuration (config.yml)

Full Configuration Example

# AnnouncementGUI configuration

# Local server identifier for this instance
localServerId: "server-1"

# List of known server IDs admins can choose from in the GUI
servers:
  - "server-1"
  - "server-2"
  - "server-3"

# If true, servers will run announcements with target = ALL
enableAllServersAnnouncements: true

# How often (in seconds) the change poller checks for announcement updates on MySQL (lightweight, no special privileges needed)

# Only applies when using MySQL; defaults to 10 seconds for fast cross-server sync
changePollingIntervalSeconds: 10

# Storage configuration for announcements (shared across servers)
storage:
  type: sqlite # sqlite or mysql
  sqlite:
    file: announcements.db
  mysql:
    host: localhost
    port: 3306
    database: announcements
    username: root
    password: password
    params: "useSSL=false&serverTimezone=UTC"

⚙️ Configuration Options Explained

Server Configuration

localServerId

  • Type: String

  • Default: "server-1"

  • Description: Unique identifier for this server instance. Used to target specific servers for announcements.

Example:

servers

  • Type: List of Strings

  • Default: ["server-1", "server-2", "server-3"]

  • Description: List of all server IDs in your network. These appear as options when creating announcements.

Example:

enableAllServersAnnouncements

  • Type: Boolean

  • Default: true

  • Description: When enabled, this server will run announcements that target "ALL" servers.

Example:

Use Cases:

  • Set to true on all servers for network-wide announcements

  • Set to false on specific servers to exclude them from ALL announcements

Polling Configuration

changePollingIntervalSeconds

  • Type: Integer

  • Default: 10

  • Description: How often (in seconds) the plugin checks for changes when using MySQL. Lower values = faster sync but more database queries.

Example:

Recommendations:

  • Small networks (2-5 servers): 5-10 seconds

  • Medium networks (5-15 servers): 10-15 seconds

  • Large networks (15+ servers): 15-30 seconds

Storage Configuration

SQLite Storage

When to use: Single server or servers sharing a filesystem.

Options:

  • file: Name of the SQLite database file (stored in plugin folder)

Advantages:

  • No additional setup required

  • Simple and reliable

  • Good for single servers

Limitations:

  • Not ideal for multi-server networks

  • No real-time cross-server sync

MySQL Storage

When to use: Multi-server networks requiring real-time synchronization.

Options:

  • host: MySQL server hostname or IP address

  • port: MySQL server port (default: 3306)

  • database: Database name for announcements

  • username: MySQL username

  • password: MySQL password (use strong passwords!)

  • params: Additional JDBC connection parameters

Common Parameters:

Advantages:

  • Real-time multi-server synchronization

  • Centralized announcement management

  • Automatic change detection

📝 GUI Messages Configuration (gui-messages.yml)

Full Configuration Example

Message Customization

You can customize all messages using:

  • Color Codes: Use & codes (e.g., &a for green, &c for red)

  • Formatting: &l (bold), &o (italic), &n (underline), &m (strikethrough)

  • Reset: &r to reset formatting

Message Placeholders

Some messages support placeholders:

  • %servers%: Replaced with comma-separated list of server IDs

🎨 GUI Configuration Files

GUI layout files are located in plugins/AnnouncementGUI/guis/. These files control:

  • GUI size and title

  • Item positions and materials

  • Item names and lore

  • Click actions

Example GUI Configuration

Note: Modifying GUI files requires server restart/reload to take effect.

🔄 Reloading Configuration

1

Edit configuration files

Make the desired edits to config.yml, gui-messages.yml, or GUI files.

2

A full server restart is recommended to apply all changes.

3

Optional: Use server reload

You may use your server's reload command, but this can cause issues. Prefer a restart for changes like storage type.

📋 Configuration Examples

Example 1: Single Server Setup

Example 2: Multi-Server Network (MySQL)

Server 1 (Lobby):

Server 2 (Survival):

Example 3: Hub Server (Only ALL Announcements)

Example 4: Game Server (Specific + ALL)

🔒 Security Best Practices

  1. Use strong MySQL passwords

  2. Create a dedicated MySQL user

  3. Enable SSL for MySQL (if over internet)

  4. Restrict file permissions on config files

🐛 Configuration Troubleshooting

Issue: "Failed to connect to MySQL"

Solutions:

  • Verify MySQL credentials

  • Check MySQL server is running

  • Ensure firewall allows connection

  • Test with MySQL client: mysql -h HOST -u USER -p

Issue: Changes not syncing across servers

Solutions:

  • Verify all servers use same MySQL database

  • Check changePollingIntervalSeconds (increase if needed)

  • Ensure all servers have storage.type: mysql

Issue: Announcements not running

Solutions:

  • Check localServerId matches target server

  • Verify enableAllServersAnnouncements: true for ALL announcements

  • Ensure announcement is enabled in GUI


Next Steps:

  • Commands Guide - Learn available commands

  • Multi-Server Setup - Detailed multi-server guide

  • GUI Guide - How to use the interface