godx4u_

Develop a 1.21.1 Paper plugin that allows users to send announcements using the command /announce <message>, which will display a customizable title and message to all players. Include support for color codes and formatting options, as well as permissions for who can use the command. Implement a user-friendly configuration file to allow server admins to set default styles and messages

Kodari AI
KodariApr 15 at 10:15 am 6,234 (v2)
AnnounceX
A feature-rich announcement plugin for Paper 1.21.1 servers. Allows authorized players to broadcast announcements via /announce <message>, displaying a fully customizable title and chat message to all online players. Supports MiniMessage formatting (colors, gradients, bold, etc.). Server admins can configure default title text, subtitle prefix, timing (fade-in, stay, fade-out), chat prefix, and permission nodes through a clean config.yml.

Planning the classes:

  • AnnounceX.java — main plugin, holds managers

  • ConfigManager.java — wraps config.yml values

  • ColorUtil.java — MiniMessage deserializer

  • AnnounceCommand.java — handles /announce

  • config.yml + plugin.yml

AnnounceX is fully built — /announce <message> broadcasts a MiniMessage-formatted title + chat message to all players, with a /announce reload subcommand, a clean config.yml for admins to customize title text, timing, prefix, and all messages, and two permission nodes (announcex.use, announcex.reload) both defaulting to ops.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 263
src/main/java/com/announcex/AnnounceX.java
package com.announcex;

import com.announcex.command.AnnounceCommand;
import com.announcex.config.ConfigManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

public class AnnounceX extends JavaPlugin {

    @Getter
    private ConfigManager configManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.configManager = new ConfigManager(this);

        AnnounceCommand announceCommand = new AnnounceCommand(this);
        getCommand("announce").setExecutor(announceCommand);
        getCommand("announce").setTabCompleter(announceCommand);

        getLogger().info("AnnounceX enabled successfully.");
    }

    @Override
    public void onDisable() {
        getLogger().info("AnnounceX disabled.");
    }
}