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.
- 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.
---
- 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.
---
- 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.
---
- 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
---
- 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
---
- 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
---
- 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
---
- 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:
�FFAAHello!
Example:
messages: - "�FFAAWelcome to the server!"
Use the modern Adventure API where appropriate instead of deprecated chat APIs.
---
- 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.
---
- 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.
---
- 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
---
- 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.
---
- 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.
---
- 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
---
- 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.
---
- 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.
---
- 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
---
- 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.
---
- 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.
---
- README.md
Create a complete "README.md".
Explain:
- What the plugin does
- Requirements
- Installation
- Configuration
- How to create Auto Messages
- How to remove Auto Messages
- How to enable/disable messages
- How to change intervals
- Commands
- Permissions
- Color codes
- HEX colors
- PlaceholderAPI
- Random mode
- Sequential mode
- Reloading configuration
- Troubleshooting
- Building the plugin
---
- 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.
---
- 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.
---
- 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.
---
- 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.
Step 1 — Architecture
AutoMessage uses four primary components:
AutoMessagePlugininitializes configuration, commands, and scheduling.MessageManagerloads and validates YAML entries, handles message selection, colors, prefixes, and PlaceholderAPI.MessageSchedulercreates one delayed task per enabled auto message and safely rebuilds tasks on reload.AutoMessageCommandimplements/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
.
├── 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-SNAPSHOTJava release 21
Optional PlaceholderAPI API dependency
Lombok for compile-time model accessors
maven-compiler-plugin
The generated artifact name is:
AutoMessage.jar
Step 4 — Java Classes
Created the following complete Java classes:
AutoMessagePlugin.javaInitializes the plugin.
Generates the default configuration.
Loads messages.
Starts and stops scheduling.
Registers the
/automessagecommand and/amalias.
AutoMessage.javaStores message ID, interval, mode, enabled status, prefix setting, and message choices.
Supports sequential and random selection.
MessageManager.javaReloads 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.javaSchedules each auto message independently.
Uses delayed tasks instead of unnecessary repeating tick checks.
Cancels old tasks during reload.
Prevents duplicate schedules.
AutoMessageCommand.javaImplements:
/am/am help/am reload/am list/am enable <id>/am disable <id>/am send <id>
Includes permission checks and tab completion.
ColorUtil.javaConverts
&color codes and&#RRGGBBHEX colors into Adventure components.
Step 5 — plugin.yml
Created with:
Plugin metadata
Paper API version
1.21/automessagecommand/amaliasOptional
PlaceholderAPIsoft dependencyAll requested permissions
automessage.adminpermission inheritance
Available permissions:
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:
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:
mvn clean package
The generated JAR will be located at:
target/AutoMessage.jar
Step 9 — Installation
Copy the generated JAR into the Paper server:
server/
└── plugins/
└── AutoMessage.jar
Then:
Start or restart the Paper server.
Confirm the console reports:
Plain Text[AutoMessage] Plugin enabled. [AutoMessage] Loaded 4 auto messages.Edit:
Plain Textplugins/AutoMessage/config.ymlApply changes with:
Plain Text/am reload
PlaceholderAPI may optionally be installed in the same plugins directory.
Step 10 — Testing Checklist
Confirm the plugin enables successfully.
Confirm the default messages load.
Wait for a scheduled message.
Test
/am help.Test
/am list.Test
/am reload.Test
/am enable <id>.Test
/am disable <id>.Test
/am send <id>.Verify sequential mode cycles in order.
Verify random mode selects different entries.
Test legacy color codes.
Test HEX colors such as
�FFAA.Test multi-line YAML messages.
Test
use-prefix: false.Install PlaceholderAPI and test
%player_name%.Remove PlaceholderAPI and confirm the plugin still starts.
Add an invalid interval and verify only that entry is skipped.
Add an invalid mode and verify only that entry is skipped.
Reload repeatedly and confirm no duplicate broadcasts occur.
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();
}
}
}