kyonog

MASTER DEVELOPMENT PROMPT — ANNOUNCEMENT OG

  1. PROJECT INFORMATION

Plugin Name: Announcement OG Author: KyonOG Main Command: "/announcement" Minecraft Version: 1.21.11 Platform: Paper / Purpur Language: Java Build System: Maven Java Version: Java 21 (or the version officially required by the target server)

  1. MAIN CONCEPT

Develop a premium, highly customizable Minecraft announcement plugin named Announcement OG, created by KyonOG.

The plugin should allow administrators to create beautiful, professional, animated announcements without manually writing complicated formatting codes.

When an admin executes:

"/announcement"

A sophisticated GUI-based announcement editor should open.

The entire system must be beginner-friendly, interactive, and visually impressive.

  1. GUI ANNOUNCEMENT EDITOR

Create a professional inventory GUI with the following options:

  • Create New Announcement
  • Edit Announcement
  • Delete Announcement
  • Preview Announcement
  • Send Announcement
  • Save Template
  • Load Template
  • Animation Settings
  • Color Settings
  • Line Editor
  • Global Settings

Use attractive GUI item names, custom colored lore, and intuitive inventory layouts.

Use different GUI icons for each option.

  1. INTERACTIVE LINE EDITOR

This is the most important feature.

Before creating an announcement, show the admin a guide explaining which text belongs on each line.

Example:

ANNOUNCEMENT LAYOUT

Line 1: Main Header / Server Name

Line 2: Empty / Decorative Separator

Line 3: Main Announcement Title

Line 4: Announcement Description

Line 5: Additional Information

Line 6: Requirements / Details

Line 7: Important Message

Line 8: Footer / Server Information

Allow administrators to:

  • Add new lines.
  • Remove existing lines.
  • Edit individual lines.
  • Change line order.
  • Customize line alignment.
  • Enable or disable individual lines.
  • Add blank spacing between lines.

Each line should have its own independent formatting settings.

  1. CHAT TEXT INPUT SYSTEM

When an admin clicks a line in the GUI, open an interactive text input system.

Use anvil GUI, chat-based input, or a compatible input system.

The admin should be able to enter custom text for every line.

Example:

Line 1: &8&m━━━━━━━━━━━━━━━━ Line 2: &c&lK Y O N O G Line 3: &7A NEW EVENT IS STARTING!

Line 4: &fJoin us for an exciting PvP event.

Line 5: &ePlayers Required: &a8 Line 6: &bJoin Now!

Line 7: &8&m━━━━━━━━━━━━━━━━

Do not hardcode this example. Every line must be editable.

  1. ADVANCED COLOR SYSTEM

Implement a complete color customization system.

Supported colors:

  • Standard Minecraft colors.
  • HEX colors (#FF0000).
  • RGB colors.
  • Gradient colors.
  • Custom color picker GUI.
  • Per-line color selection.
  • Per-word color customization.

Support MiniMessage formatting, including gradients and suitable text formatting tags.

Examples:

"gradient:red:dark_red" (gradient:red:dark_red)ANNOUNCEMENT</gradient>

<rainbow>WELCOME TO THE SERVER</rainbow>

<gold><bold>IMPORTANT MESSAGE</bold></gold>

  1. TEXT EFFECTS

Implement customizable text effects:

  • Bold
  • Italic
  • Underline
  • Strikethrough
  • Obfuscated
  • Gradient
  • Rainbow
  • Shadow-style formatting where supported
  • Custom separators
  • Decorative symbols

Allow effects to be enabled individually for each line.

  1. ANNOUNCEMENT ANIMATIONS

Add optional animations to make announcements look premium.

Animation options:

  1. Fade-in effect.
  2. Typewriter effect.
  3. Line-by-line reveal.
  4. Gradient animation.
  5. Rainbow cycling.
  6. Scrolling text effect.
  7. Flashing highlight effect.
  8. Static announcement.

Allow admins to configure:

  • Animation speed.
  • Animation duration.
  • Delay between lines.
  • Repeat count.
  • Animation enable/disable.

Animations must be optimized and must not create excessive server load.

  1. LIVE PREVIEW SYSTEM

Add a preview button inside the GUI.

When clicked, show the announcement to the admin exactly as players would see it.

Allow admins to go back to editing without losing their changes.

Provide a final confirmation before sending an announcement globally.

  1. BROADCAST SYSTEM

When the admin clicks Send Announcement:

  • Send the announcement to all online players.
  • Preserve all colors and formatting.
  • Preserve line spacing.
  • Apply the selected animation.
  • Support players joining after the announcement if configured.
  • Play an optional notification sound.
  • Support configurable sound selection and volume.

The announcement should look consistent across supported Minecraft clients.

  1. COMMANDS

Main command:

"/announcement"

Additional commands:

  • "/announcement create"
  • "/announcement edit"
  • "/announcement preview"
  • "/announcement send"
  • "/announcement delete"
  • "/announcement reload"
  • "/announcement help"

Add tab completion for all commands.

  1. PERMISSIONS

Implement:

  • announcement.admin
  • announcement.create
  • announcement.edit
  • announcement.send
  • announcement.reload

Only authorized players should be able to access administrative features.

Console should also be able to execute supported commands.

  1. CONFIGURATION FILES

Generate:

config.yml

  • Default colors.
  • Default animations.
  • Sound settings.
  • Announcement settings.
  • Permission settings.

announcements.yml

  • Saved announcement templates.
  • Individual line content.
  • Formatting.
  • Animation configurations.

messages.yml

  • Customizable plugin messages.

All configurations must persist after server restarts.

  1. DEFAULT TEMPLATE

Include a beautiful default announcement template:

━━━━━━━━━━━━━━━━━━━━

ANNOUNCEMENT

A SPECIAL EVENT!

An exciting event is coming to our server!

Players Required: 8

Join now and participate!

━━━━━━━━━━━━━━━━━━━━

Use attractive red, black, white, and gold styling.

  1. PERFORMANCE & CODE QUALITY
  • Use efficient Bukkit/Paper APIs.
  • Avoid unnecessary repeating tasks.
  • Prevent memory leaks.
  • Properly cancel animation tasks.
  • Validate all user inputs.
  • Prevent GUI item manipulation exploits.
  • Handle offline players and console execution.
  • Use asynchronous operations only where safe.
  • Keep all Minecraft API interactions on the main thread.
  • Avoid unnecessary dependencies.
  • Follow clean object-oriented Java architecture.
  1. PROJECT STRUCTURE

Create a complete Maven project:

AnnouncementOG/ ├── pom.xml ├── src/main/java/ │ └── com/kyonog/announcementog/ │ ├── AnnouncementOG.java │ ├── commands/ │ ├── gui/ │ ├── editor/ │ ├── animations/ │ ├── formatting/ │ ├── storage/ │ ├── listeners/ │ └── utils/ └── src/main/resources/ ├── plugin.yml ├── config.yml ├── announcements.yml └── messages.yml

  1. FINAL DELIVERABLES

Provide:

  1. Complete working Java source code.
  2. Complete Maven project.
  3. Correct plugin.yml.
  4. All configuration files.
  5. Working GUI editor.
  6. Working text input system.
  7. Fully functional color and formatting system.
  8. Working animation engine.
  9. Preview and broadcast functionality.
  10. Build instructions.
  11. Compiled AnnouncementOG.jar.

IMPORTANT:

Do not provide pseudocode, incomplete classes, placeholder methods, or fake implementations.

Every GUI button must perform its actual function.

Every command must work.

Ensure compatibility with the specified Minecraft server version.

PLUGIN BRANDING:

Plugin Name: Announcement OG

Author: KyonOG

Plugin identity should feel premium, modern, professional, and recognizable as a KyonOG creation.

Kodari AI
KodariNov 4 at 11:51 am 3
AnnouncementOG
A premium Minecraft announcement plugin with a sophisticated GUI editor, interactive line-by-line text input system, advanced color formatting including gradients and rainbow effects, customizable animations like typewriter and fade-in, live preview functionality, global broadcast system with configurable sounds, persistent template storage, and comprehensive permission management. Features a beginner-friendly interface with intuitive controls for creating professional animated announcements without manual formatting codes.
  1. Create the Maven project and persistent template configuration.

  2. Build the GUI editor, chat input, formatting, preview, and broadcast flow.

  3. Add commands, permissions, and configurable animation and sound settings.

Created the Maven project with a GUI line editor, chat input, template storage, preview, broadcast confirmation, and static or line-by-line announcements.

The full specification is not yet complete: the additional animation modes, per-line alignment and toggles, graphical color picker, and in-GUI global settings are not implemented. The project has not been compiled or verified, so a JAR is not available yet.

To build it in Kodari, click Compile in the top bar, then Compile in the window. If it succeeds, click Download. On phone, use ⋮ → Compile Project.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
6 357
src/main/java/com/kyonog/announcementog/AnnouncementOG.java
package com.kyonog.announcementog;

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;
import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XSound;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

public final class AnnouncementOG extends JavaPlugin implements Listener, CommandExecutor, TabCompleter {
    private final Map<UUID, Draft> drafts = new HashMap<>();
    private final Map<UUID, Input> inputs = new ConcurrentHashMap<>();
    private final List<BukkitTask> tasks = new ArrayList<>();
    private YamlConfiguration templates;
    private YamlConfiguration messages;
    private File templateFile;
    private Draft lastBroadcast;

    private static final class Draft {
        final List<String> lines = new ArrayList<>();
        String animation = "STATIC";
        int speed = 10;
        int repeat = 1;
        Draft copy() {
            Draft result = new Draft();
            result.lines.addAll(lines); result.animation = animation; result.speed = speed; result.repeat = repeat;
            return result;
        }
    }
    private record Input(String action, int index) {}
    private static final class Menu implements InventoryHolder {
        final String type;
        final int page;
        Inventory inventory;
        Menu(String type, int page) { this.type = type; this.page = page; }
        @Override public Inventory getInventory() { return inventory; }
    }

    @Override public void onEnable() {
        saveDefaultConfig();
        saveResource("announcements.yml", false);
        saveResource("messages.yml", false);
        loadFiles();
        Bukkit.getPluginManager().registerEvents(this, this);
        getCommand("announcement").setExecutor(this);
        getCommand("announcement").setTabCompleter(this);
    }
    @Override public void onDisable() {
        for (BukkitTask task : tasks) task.cancel();
        tasks.clear(); inputs.clear(); drafts.clear();
    }
    private void loadFiles() {
        templateFile = new File(getDataFolder(), "announcements.yml");
        templates = YamlConfiguration.loadConfiguration(templateFile);
        messages = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml"));
    }
    private void message(CommandSender sender, String key) {
        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', messages.getString("prefix", "") + messages.getString(key, key)));
    }
    private boolean allowed(CommandSender sender, String permission) {
        if (sender.hasPermission("announcement.admin") || sender.hasPermission("announcement." + permission)) return true;
        message(sender, "no-permission"); return false;
    }
    private Draft draft(Player player) {
        return drafts.computeIfAbsent(player.getUniqueId(), id -> {
            Draft loaded = load("default");
            return loaded == null ? new Draft() : loaded;
        });
    }
    private Draft load(String name) {
        String path = "templates." + name;
        if (!templates.isConfigurationSection(path)) return null;
        Draft d = new Draft();
        d.lines.addAll(templates.getStringList(path + ".lines"));
        d.animation = templates.getString(path + ".animation", getConfig().getString("defaults.animation", "STATIC"));
        d.speed = Math.max(1, templates.getInt(path + ".speed-ticks", 10));
        d.repeat = Math.max(1, Math.min(10, templates.getInt(path + ".repeat", 1)));
        return d;
    }
    private boolean validName(String name) { return name.matches("[A-Za-z0-9_-]{1,32}"); }
    private void save(Player player, String name) {
        if (!validName(name)) { player.sendMessage("§cUse 1–32 letters, digits, underscores or hyphens."); return; }
        Draft d = draft(player); String path = "templates." + name;
        templates.set(path + ".lines", d.lines); templates.set(path + ".animation", d.animation);
        templates.set(path + ".speed-ticks", d.speed); templates.set(path + ".repeat", d.repeat);
        try { templates.save(templateFile); player.sendMessage("§aSaved template: §f" + name); }
        catch (IOException e) { getLogger().warning("Could not save templates: " + e.getMessage()); player.sendMessage("§cCould not save template; check the server log."); }
    }
    private Component format(String input) {
        try {
            Component parsed = MiniMessage.miniMessage().deserialize(input);
            String legacy = LegacyComponentSerializer.legacyAmpersand().serialize(parsed);
            return LegacyComponentSerializer.builder().character('&').hexColors().useUnusualXRepeatedCharacterHexFormat().build().deserialize(legacy);
        } catch (RuntimeException ex) { return Component.text(input); }
    }
    private ItemStack icon(String material, String name, String... lore) {
        ItemStack item = XMaterial.matchXMaterial(material).map(XMaterial::parseItem).orElse(null);
        if (item == null) throw new IllegalStateException("Missing menu material " + material);
        ItemMeta meta = item.getItemMeta(); meta.setDisplayName("§r" + name);
        meta.setLore(Arrays.asList(lore)); item.setItemMeta(meta); return item;
    }
    private Inventory menu(String type, int page, int size, String title) {
        Menu holder = new Menu(type, page);
        holder.inventory = Bukkit.createInventory(holder, size, title); return holder.inventory;
    }
    private void openMain(Player p) {
        Inventory inv = menu("main", 0, 27, "§8Announcement §cOG");
        inv.setItem(10, icon("WRITABLE_BOOK", "§aCreate new", "§7Start with a blank draft"));
        inv.setItem(11, icon("BOOK", "§eLine editor", "§7Edit, reorder and remove lines"));
        inv.setItem(12, icon("ENDER_EYE", "§bPreview", "§7See your current draft"));
        inv.setItem(13, icon("PAPER", "§cSend announcement", "§7Confirmation required"));
        inv.setItem(14, icon("CHEST", "§6Save template", "§7Enter a template name"));
        inv.setItem(15, icon("BOOKSHELF", "§dLoad template", "§7Enter a template name"));
        inv.setItem(16, icon("BARRIER", "§cDelete template", "§7Enter a template name"));
        inv.setItem(20, icon("CLOCK", "§eAnimation settings", "§7Cycle animation, speed and repeats"));
        inv.setItem(22, icon("NAME_TAG", "§bColor and effects", "§7Use & codes or MiniMessage tags", "§7Example: <gradient:red:gold>Text</gradient>"));
        inv.setItem(24, icon("COMPARATOR", "§6Global settings", "§7Edit config.yml, then reload"));
        p.openInventory(inv);
    }
    private void openLines(Player p, int page) {
        Draft d = draft(p); int maxPage = Math.max(0, (d.lines.size() - 1) / 45); page = Math.max(0, Math.min(page, maxPage));
        Inventory inv = menu("lines", page, 54, "§8Line editor §7" + (page + 1));
        for (int i = 0; i < 45 && page * 45 + i < d.lines.size(); i++) {
            int n = page * 45 + i; String text = d.lines.get(n);
            inv.setItem(i, icon("PAPER", "§eLine " + (n + 1), "§7" + (text.length() > 80 ? text.substring(0, 80) + "..." : text), "§aLeft: edit §cRight: delete", "§bShift-left: move up §bShift-right: move down"));
        }
        inv.setItem(45, icon("ARROW", "§ePrevious page"));
        inv.setItem(48, icon("LIME_DYE", "§aAdd line", "§7An empty line creates spacing"));
        inv.setItem(49, icon("OAK_DOOR", "§eBack"));
        inv.setItem(53, icon("ARROW", "§eNext page")); p.openInventory(inv);
    }
    private void openAnimation(Player p) {
        Draft d = draft(p); Inventory inv = menu("animation", 0, 27, "§8Animation settings");
        inv.setItem(11, icon("CLOCK", "§eMode: §f" + d.animation, "§7Click to cycle"));
        inv.setItem(13, icon("SUGAR", "§eDelay: §f" + d.speed + " ticks", "§7Left: +1, right: -1"));
        inv.setItem(15, icon("REPEATER", "§eRepeats: §f" + d.repeat, "§7Left: +1, right: -1"));
        inv.setItem(22, icon("OAK_DOOR", "§eBack")); p.openInventory(inv);
    }
    private void confirm(Player p) {
        Inventory inv = menu("confirm", 0, 27, "§8Confirm broadcast");
        inv.setItem(11, icon("LIME_DYE", "§aConfirm send")); inv.setItem(15, icon("RED_DYE", "§cCancel")); p.openInventory(inv);
    }
    private void input(Player p, String action, int index) {
        inputs.put(p.getUniqueId(), new Input(action, index)); p.closeInventory(); message(p, "input");
    }
    @EventHandler public void onChat(AsyncPlayerChatEvent event) {
        UUID id = event.getPlayer().getUniqueId(); Input pending = inputs.remove(id);
        if (pending == null) return;
        event.setCancelled(true); String text = event.getMessage();
        Bukkit.getScheduler().runTask(this, () -> {
            Player p = Bukkit.getPlayer(id); if (p == null) return;
            if (text.equalsIgnoreCase("cancel")) { openMain(p); return; }
            if (text.length() > Math.max(1, getConfig().getInt("announcement.max-line-length", 500))) { p.sendMessage("§cInput is too long."); openMain(p); return; }
            Draft d = draft(p);
            switch (pending.action()) {
                case "edit" -> { if (pending.index() >= 0 && pending.index() < d.lines.size()) d.lines.set(pending.index(), text); openLines(p, pending.index() / 45); }
                case "add" -> { if (d.lines.size() < Math.max(1, getConfig().getInt("announcement.max-lines", 40))) d.lines.add(text.equalsIgnoreCase("blank") ? "" : text); else p.sendMessage("§cMaximum line count reached."); openLines(p, (d.lines.size() - 1) / 45); }
                case "save" -> { save(p, text); openMain(p); }
                case "load" -> { Draft loaded = validName(text) ? load(text) : null; if (loaded == null) message(p, "not-found"); else { drafts.put(id, loaded); p.sendMessage("§aLoaded " + text); } openMain(p); }
                case "delete" -> { if (!validName(text) || !templates.isConfigurationSection("templates." + text)) message(p, "not-found"); else { templates.set("templates." + text, null); try { templates.save(templateFile); p.sendMessage("§aDeleted " + text); } catch (IOException e) { p.sendMessage("§cCould not save templates."); getLogger().warning(e.getMessage()); } } openMain(p); }
                default -> openMain(p);
            }
        });
    }
    @EventHandler public void onQuit(PlayerQuitEvent e) { inputs.remove(e.getPlayer().getUniqueId()); drafts.remove(e.getPlayer().getUniqueId()); }
    @EventHandler public void onJoin(PlayerJoinEvent e) { if (getConfig().getBoolean("announcement.replay-on-join") && lastBroadcast != null) display(Collections.singletonList(e.getPlayer()), lastBroadcast.copy()); }