Санжар Үмбет

Create a complete, production-ready Minecraft Java Edition Auto Message plugin for a Paper server.

The plugin should automatically send configurable messages to the server chat at specified intervals. It must be simple for server administrators to configure, lightweight, reliable, and easy to maintain.

  1. Technology

Use:

  • Java
  • Paper API
  • Maven
  • "plugin.yml"
  • YAML configuration
  • Adventure API for modern text formatting where appropriate

The plugin should support a modern Minecraft/Paper version. Use a stable and appropriate Paper API version and clearly explain which version you chose and why.

---

  1. Main Features

The plugin must:

  • Automatically send messages to the server chat.
  • Support multiple independent auto messages.
  • Allow each message to have its own settings.
  • Allow messages to be enabled or disabled individually.
  • Allow different intervals for different messages.
  • Support single-line and multi-line messages.
  • Support Minecraft color codes.
  • Support HEX colors.
  • Support PlaceholderAPI optionally.
  • Support sequential and random message modes.
  • Support "/am reload".
  • Have proper permission handling.
  • Have clear console logging.
  • Handle invalid configuration safely.
  • Avoid unnecessary server performance impact.

---

  1. Configuration

Create a clean and well-documented "config.yml".

Example:

enabled: true

prefix: "&8[&bServer&8] "

messages:

welcome: enabled: true interval: 60 mode: sequential messages: - "&aWelcome to our Minecraft server!" - "&eHave fun and enjoy playing!"

discord: enabled: true interval: 120 mode: sequential messages: - "&bJoin our Discord server!" - "&fdiscord.example.com"

store: enabled: false interval: 180 mode: random messages: - "&6Visit our store!" - "&eBuy ranks and cosmetics:" - "&fstore.example.com"

Explain every configuration option in comments.

---

  1. Multiple Auto Messages

Each auto message must be completely independent.

For example:

messages:

welcome: enabled: true interval: 60

discord: enabled: true interval: 120

rules: enabled: true interval: 300

store: enabled: false interval: 600

Each message must have its own:

  • ID/name
  • enabled state
  • interval
  • mode
  • message list

---

  1. Message Modes

Implement two modes.

Sequential

Messages are displayed in order:

Message 1 Message 2 Message 3 Message 1 Message 2 Message 3

Random

A random message is selected each time.

Configuration:

mode: random

or:

mode: sequential

---

  1. Commands

Create the following commands:

/am /am help /am reload /am list /am enable <id> /am disable <id> /am send <id>

"/am reload"

Reload all configuration without restarting the server.

"/am list"

Display all configured Auto Messages and their status.

Example:

[AutoMessage] Configured messages:

welcome - ENABLED discord - ENABLED rules - ENABLED store - DISABLED

"/am enable <id>"

Enable an Auto Message.

Example:

/am enable discord

"/am disable <id>"

Disable an Auto Message.

Example:

/am disable discord

"/am send <id>"

Immediately send the selected Auto Message.

Example:

/am send welcome

---

  1. Permissions

Create permissions:

automessage.admin automessage.reload automessage.list automessage.enable automessage.disable automessage.send

"automessage.admin" should grant access to all administrative commands.

Default permission should be:

op

---

  1. Color Support

Support traditional Minecraft color codes:

&0 &1 &2 ... &9 &a &b &c &d &e &f

Also support formatting codes where appropriate.

Additionally support HEX colors:

&#00FFAAHello!

Example:

messages: - "&#00FFAAWelcome to the server!"

Use the modern Adventure API where appropriate instead of deprecated chat APIs.

---

  1. Multi-Line Messages

Allow messages to contain multiple lines.

Example:

messages: - "&8&m------------------------" - "&aWelcome to the server!" - "&eDiscord: &fdiscord.example.com" - "&8&m------------------------"

Each line should be sent correctly to the chat.

---

  1. PlaceholderAPI Support

Add optional PlaceholderAPI support.

For example:

messages: - "&aHello, %player_name%!" - "&eOnline players: &f%server_online%"

If PlaceholderAPI is not installed:

  • The plugin must NOT crash.
  • The plugin must continue working.
  • PlaceholderAPI functionality should simply be disabled.

Make PlaceholderAPI an optional dependency.

---

  1. Prefix

Allow a global prefix:

prefix: "&8[&bServer&8] "

The final message should look like:

[Server] Welcome to the server!

Also allow individual messages to disable the prefix if possible.

For example:

use-prefix: false

---

  1. Scheduling

Implement a reliable scheduler.

The interval must be configurable in seconds:

interval: 60

Do not create unnecessary repeating tasks.

The plugin should:

  • Start scheduling when enabled.
  • Stop scheduling when disabled.
  • Restart/reload schedules correctly after "/am reload".
  • Prevent duplicate scheduled tasks after reload.
  • Cancel tasks when the plugin is disabled.

Make sure "/am reload" never creates duplicate message tasks.

---

  1. Performance

The plugin must be lightweight.

Requirements:

  • Avoid unnecessary loops.
  • Avoid checking every tick if it is not required.
  • Use Paper/Bukkit Scheduler correctly.
  • Do not block the main server thread.
  • Avoid memory leaks.
  • Cancel scheduled tasks correctly.
  • Do not create unnecessary objects repeatedly.
  • Keep the implementation simple and efficient.

---

  1. Error Handling

The plugin must handle invalid configuration safely.

For example:

interval: abc

or:

mode: something

should not completely crash the plugin.

Instead, log a clear error:

[AutoMessage] Invalid interval for message 'discord'. [AutoMessage] Skipping message 'discord'.

The other valid Auto Messages should continue working.

Also handle:

  • Missing configuration sections
  • Empty message lists
  • Invalid message IDs
  • Invalid modes
  • Invalid intervals
  • Missing PlaceholderAPI

---

  1. Console Logging

When the plugin starts:

[AutoMessage] Plugin enabled. [AutoMessage] Loaded 4 auto messages.

When configuration reloads:

[AutoMessage] Configuration reloaded. [AutoMessage] Loaded 4 auto messages.

When there is an error:

[AutoMessage] ERROR: Invalid interval for message 'discord'.

Keep logging useful but not excessively verbose.

---

  1. Project Structure

Do NOT put everything into one Java class.

Use a clean architecture similar to:

src/ └── main/ ├── java/ │ └── me/ │ └── example/ │ └── automessage/ │ ├── AutoMessagePlugin.java │ │ │ ├── command/ │ │ └── AutoMessageCommand.java │ │ │ ├── manager/ │ │ └── MessageManager.java │ │ │ ├── model/ │ │ └── AutoMessage.java │ │ │ ├── scheduler/ │ │ └── MessageScheduler.java │ │ │ └── util/ │ └── ColorUtil.java │ └── resources/ ├── plugin.yml └── config.yml

You may improve this architecture if there is a better approach.

---

  1. plugin.yml

Create a complete "plugin.yml".

It should include:

  • Plugin name
  • Version
  • Main class
  • API version
  • Commands
  • Permissions
  • Optional dependency information if required

Example:

name: AutoMessage version: 1.0.0 main: me.example.automessage.AutoMessagePlugin api-version: '1.21'

commands: automessage: description: Manage automatic server messages aliases: - am permission: automessage.admin

permissions: automessage.admin: description: Full access to AutoMessage default: op

---

  1. Default Configuration

When the plugin is installed for the first time, it must automatically generate a complete default "config.yml".

The default configuration should contain several example messages.

Add comments explaining what every setting does.

---

  1. Messages Should Be Easy to Customize

The server owner should be able to modify messages without touching Java code.

Everything important should be configurable through YAML.

The administrator should be able to:

  • Add new messages
  • Delete messages
  • Change intervals
  • Enable/disable messages
  • Change message text
  • Change modes
  • Change prefix
  • Reload configuration

without recompiling the plugin.

---

  1. README.md

Create a complete "README.md".

Explain:

  1. What the plugin does
  2. Requirements
  3. Installation
  4. Configuration
  5. How to create Auto Messages
  6. How to remove Auto Messages
  7. How to enable/disable messages
  8. How to change intervals
  9. Commands
  10. Permissions
  11. Color codes
  12. HEX colors
  13. PlaceholderAPI
  14. Random mode
  15. Sequential mode
  16. Reloading configuration
  17. Troubleshooting
  18. Building the plugin

---

  1. Build Instructions

Provide complete instructions for building the plugin.

For example:

mvn clean package

Explain where the generated ".jar" file will be located.

Then explain:

server/ └── plugins/ └── AutoMessage.jar

Explain how to start the server and verify that the plugin loaded correctly.

---

  1. Code Quality

Follow good Java practices:

  • Clear class names
  • Clear method names
  • Proper encapsulation
  • Avoid unnecessary static variables
  • Avoid duplicated code
  • Use dependency injection where useful
  • Use appropriate collections
  • Add useful comments only where needed
  • Do not over-engineer the plugin

The code should be understandable to an intermediate Java developer.

---

  1. Important Requirements

Do NOT:

  • Leave TODO comments instead of implementing features.
  • Use "..." instead of real code.
  • Provide incomplete classes.
  • Invent nonexistent Paper API methods.
  • Use deprecated APIs unless absolutely necessary.
  • Put the entire plugin into one class.
  • Create duplicate scheduler tasks during reload.
  • Make PlaceholderAPI a mandatory dependency.

Everything must be implemented completely.

---

  1. Final Response Structure

When generating the project, respond in this order:

Step 1 — Architecture

Briefly explain how the plugin works.

Step 2 — Project Structure

Show the complete project tree.

Step 3 — pom.xml

Provide the complete file.

Step 4 — Java Classes

Provide every Java class with complete code.

Step 5 — plugin.yml

Provide the complete file.

Step 6 — config.yml

Provide the complete default configuration.

Step 7 — README.md

Provide the complete README.

Step 8 — Build

Explain exactly how to compile the plugin.

Step 9 — Installation

Explain exactly how to install it on a Paper server.

Step 10 — Testing

Provide a testing checklist to verify every feature.

Before presenting the final project, review the code for compilation errors, API compatibility issues, scheduler problems, configuration errors, and command/permission issues.

The final result must be a complete, functional Minecraft Paper Auto Message plugin that can be compiled into a ".jar" and installed directly on a server.

Kodari AI
KodariSep 2 at 5:16 pm 3
AutoMessage
Automatically sends configurable messages to server chat at intervals. Supports multiple independent messages with individual settings, sequential/random modes, color/HEX codes, optional PlaceholderAPI, and admin commands for reload, list, enable, disable, and manual send.

Step 1 — Architecture

AutoMessage uses four primary components:

  • AutoMessagePlugin initializes configuration, commands, and scheduling.

  • MessageManager loads and validates YAML entries, handles message selection, colors, prefixes, and PlaceholderAPI.

  • MessageScheduler creates one delayed task per enabled auto message and safely rebuilds tasks on reload.

  • AutoMessageCommand implements /am, permissions, subcommands, and tab completion.

Messages use Adventure Component output with support for legacy colors, formatting codes, and HEX colors.

The project targets Paper 1.21.4 with Java 21, providing a stable modern Paper API and native Adventure support.

Step 2 — Project Structure

Plain Text
.
├── pom.xml
├── README.md
└── src
    └── main
        ├── java
        │   └── me
        │       └── example
        │           └── automessage
        │               ├── AutoMessagePlugin.java
        │               ├── command
        │               │   └── AutoMessageCommand.java
        │               ├── manager
        │               │   └── MessageManager.java
        │               ├── model
        │               │   └── AutoMessage.java
        │               ├── scheduler
        │               │   └── MessageScheduler.java
        │               └── util
        │                   └── ColorUtil.java
        └── resources
            ├── config.yml
            └── plugin.yml

Step 3 — pom.xml

Created a Maven project using:

  • Paper API 1.21.4-R0.1-SNAPSHOT

  • Java release 21

  • Optional PlaceholderAPI API dependency

  • Lombok for compile-time model accessors

  • maven-compiler-plugin

The generated artifact name is:

Plain Text
AutoMessage.jar

Step 4 — Java Classes

Created the following complete Java classes:

  • AutoMessagePlugin.java

    • Initializes the plugin.

    • Generates the default configuration.

    • Loads messages.

    • Starts and stops scheduling.

    • Registers the /automessage command and /am alias.

  • AutoMessage.java

    • Stores message ID, interval, mode, enabled status, prefix setting, and message choices.

    • Supports sequential and random selection.

  • MessageManager.java

    • Reloads configuration.

    • Validates IDs, intervals, modes, and message lists.

    • Handles global and per-message prefixes.

    • Supports multi-line messages.

    • Uses Adventure components for output.

    • Detects PlaceholderAPI safely through the plugin manager.

  • MessageScheduler.java

    • Schedules each auto message independently.

    • Uses delayed tasks instead of unnecessary repeating tick checks.

    • Cancels old tasks during reload.

    • Prevents duplicate schedules.

  • AutoMessageCommand.java

    • Implements:

      • /am

      • /am help

      • /am reload

      • /am list

      • /am enable <id>

      • /am disable <id>

      • /am send <id>

    • Includes permission checks and tab completion.

  • ColorUtil.java

    • Converts & color codes and &#RRGGBB HEX colors into Adventure components.

Step 5 — plugin.yml

Created with:

  • Plugin metadata

  • Paper API version 1.21

  • /automessage command

  • /am alias

  • Optional PlaceholderAPI soft dependency

  • All requested permissions

  • automessage.admin permission inheritance

Available permissions:

Plain Text
automessage.admin
automessage.reload
automessage.list
automessage.enable
automessage.disable
automessage.send

All permissions default to operators.

Step 6 — config.yml

Created a fully documented default configuration containing:

  • Global enable/disable setting

  • Configurable prefix

  • Welcome message

  • Discord message

  • Rules message with multiple lines

  • Disabled store message

  • Sequential mode

  • Random mode

  • Per-message enable state

  • Per-message prefix control

  • Interval values in seconds

  • Legacy and HEX color examples

Example:

YAML
enabled: true

prefix: "&8[&bServer&8] "

messages:
  welcome:
    enabled: true
    interval: 60
    mode: sequential
    use-prefix: true
    messages:
      - "&aWelcome to our Minecraft server!"
      - "&eHave fun and enjoy playing!"

Step 7 — README.md

Created a complete README covering:

  • Features

  • Requirements

  • Installation

  • Configuration

  • Creating and removing messages

  • Changing intervals

  • Enabling and disabling entries

  • Commands

  • Permissions

  • Legacy colors

  • HEX colors

  • Multi-line messages

  • PlaceholderAPI

  • Random mode

  • Sequential mode

  • Reload behavior

  • Troubleshooting

  • Building

  • Verification checklist

Step 8 — Build

From the project root, run:

Shell
mvn clean package

The generated JAR will be located at:

Plain Text
target/AutoMessage.jar

Step 9 — Installation

Copy the generated JAR into the Paper server:

Plain Text
server/
└── plugins/
    └── AutoMessage.jar

Then:

  1. Start or restart the Paper server.

  2. Confirm the console reports:

    Plain Text
    [AutoMessage] Plugin enabled.
    [AutoMessage] Loaded 4 auto messages.
    
  3. Edit:

    Plain Text
    plugins/AutoMessage/config.yml
    
  4. Apply changes with:

    Plain Text
    /am reload
    

PlaceholderAPI may optionally be installed in the same plugins directory.

Step 10 — Testing Checklist

  1. Confirm the plugin enables successfully.

  2. Confirm the default messages load.

  3. Wait for a scheduled message.

  4. Test /am help.

  5. Test /am list.

  6. Test /am reload.

  7. Test /am enable <id>.

  8. Test /am disable <id>.

  9. Test /am send <id>.

  10. Verify sequential mode cycles in order.

  11. Verify random mode selects different entries.

  12. Test legacy color codes.

  13. Test HEX colors such as &#00FFAA.

  14. Test multi-line YAML messages.

  15. Test use-prefix: false.

  16. Install PlaceholderAPI and test %player_name%.

  17. Remove PlaceholderAPI and confirm the plugin still starts.

  18. Add an invalid interval and verify only that entry is skipped.

  19. Add an invalid mode and verify only that entry is skipped.

  20. Reload repeatedly and confirm no duplicate broadcasts occur.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
10 839
src/main/java/me/example/automessage/AutoMessagePlugin.java
package me.example.automessage;

import me.example.automessage.command.AutoMessageCommand;
import me.example.automessage.manager.MessageManager;
import me.example.automessage.scheduler.MessageScheduler;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class AutoMessagePlugin extends JavaPlugin {

    private MessageManager messageManager;
    private MessageScheduler messageScheduler;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.messageManager = new MessageManager(this);
        int loadedMessages = messageManager.reload();

        this.messageScheduler = new MessageScheduler(this, messageManager);
        this.messageScheduler.start();

        AutoMessageCommand command = new AutoMessageCommand(messageManager, messageScheduler);
        if (getCommand("automessage") != null) {
            getCommand("automessage").setExecutor(command);
            getCommand("automessage").setTabCompleter(command);
        }

        getLogger().info("Plugin enabled.");
        getLogger().info("Loaded " + loadedMessages + " auto messages.");
    }

    @Override
    public void onDisable() {
        if (messageScheduler != null) {
            messageScheduler.stop();
        }
    }
}