๐
pasted-code-1789187388748.txt
txt
471 lines
โถ
Create a Minecraft Java plugin called ServerStart for Paper/Spigot 1.21.11
The plugin should provide a fully configurable server-start system controlled through config.yml.
1. Server Start System
Add a command:
/serverstart
When executed by an admin, it should begin the configured server-start sequence.
The sequence should work like:
WAITING โ GRACE PERIOD โ STARTED
Before the server is started, players should receive configurable announcements and the world border should be set to the configured pre-start border.
Once the grace period ends, the server officially becomes STARTED, and the border should change from the pre-start size to the configured start border size.
The server should remember whether it is currently:
WAITING
GRACE
STARTED
Do not allow /serverstart to start it again if it is already running.
2. Configurable Grace Period
Add a configurable grace period in config.yml.
Example:
grace-period:
enabled: true
duration: 300
The duration should be in seconds.
During the grace period:
Display a countdown in chat at configurable intervals.
Optionally display a BossBar countdown.
Players cannot accidentally trigger the start sequence again.
Admins should be able to skip the grace period using:
/serverstart skip
When skipped, the server should immediately enter the STARTED state.
Allow all messages and countdown intervals to be customized in the config.
3. World Border
Make the border completely configurable.
Config example:
border:
center:
x: 0
z: 0
pre-start:
size: 1000
start:
size: 500
transition-time: 30
Requirements:
Allow the border center X/Z to be customized.
Allow separate pre-start and start border sizes.
When /serverstart is executed, set the border to the pre-start size.
When the server officially starts, change it to the start size.
Use the configured transition time for the border change.
Make it possible to disable border handling entirely.
Example:
border:
enabled: true
The plugin should apply the border to the configured world.
Also make the world name configurable:
world: world
4. Announcements
Create fully configurable announcements.
Admins should be able to manually announce the server status using:
/serverstart announce
This should broadcast the message to everyone.
Also automatically announce important events:
Server start sequence initiated
Grace period started
Grace period countdown
Grace period skipped
Server officially started
Border changed
Server reset
Example config:
messages:
prefix: "&8[&5ServerStart&8] "
starting: "&aThe server start sequence has begun!"
grace-start: "&eGrace period has started!"
countdown: "&eServer starts in &f%time%&e!"
skipped: "&cGrace period skipped!"
started: "&a&lSERVER STARTED!"
reset: "&cThe server start has been reset."
already-started: "&cThe server has already started."
not-started: "&eThe server has not started yet."
Support Minecraft color codes and useful placeholders such as:
%time%
%state%
%border%
5. Status Command
Add:
/serverstart status
It should show the current server-start state.
Example:
Server Start Status
State: GRACE
Grace Period: 02:35 remaining
Border: 1000 blocks
Center: 0, 0
If started:
Server Start Status
State: STARTED
Grace Period: Finished
Border: 500 blocks
Center: 0, 0
If not started:
Server Start Status
State: WAITING
Server has not been started yet.
6. Reset System
Add:
/serverstart reset
This should completely reset the server-start system back to the initial state.
After reset:
State becomes WAITING.
Grace-period timer stops.
Countdown BossBar is removed.
Border is restored to the configured pre-start border.
Players receive the reset announcement.
/serverstart can be used again.
This allows the same world to be used for another server start without restarting the Minecraft server.
7. Admin Commands
Create the following command structure:
/serverstart
/serverstart start
/serverstart skip
/serverstart status
/serverstart reset
/serverstart announce
Permissions:
serverstart.admin
serverstart.status
serverstart.announce
serverstart.admin should allow start, skip and reset.
serverstart.status should allow checking status.
serverstart.announce should allow announcements.
Add proper tab completion.
8. Configuration
Create a clean and well-commented config.yml.
Example:
world: world
start-command:
enabled: true
grace-period:
enabled: true
duration: 300
countdown:
enabled: true
bossbar: true
announce-at:
- 300
- 180
- 120
- 60
- 30
- 10
- 5
- 4
- 3
- 2
- 1
border:
enabled: true
center:
x: 0
z: 0
pre-start:
size: 1000
start:
size: 500
transition-time: 30
messages:
prefix: "&8[&5ServerStart&8] "
starting: "&aServer start sequence initiated!"
grace-start: "&eGrace period started!"
countdown: "&eServer starts in &f%time%&e!"
skipped: "&cGrace period skipped!"
started: "&a&lSERVER STARTED!"
reset: "&cServer start system reset."
already-started: "&cThe server has already started."
not-started: "&eThe server has not started yet."
no-permission: "&cYou don't have permission."
9. Persistence
The plugin should save its current state so that if the Minecraft server restarts during the grace period, the plugin can safely restore its state.
Store necessary runtime data in a separate file such as:
data.yml
Do not permanently save the state as STARTED after /serverstart reset.
Make sure resetting completely clears the saved start state.
10. Safety and Reliability
The plugin must:
Never create multiple countdown tasks.
Never create multiple BossBars.
Correctly cancel timers when reset is used.
Correctly handle /serverstart skip.
Correctly handle server restarts.
Avoid NullPointerExceptions.
Validate configuration values.
Automatically create missing configuration files.
Have /serverstart reload for reloading configuration.
Send useful console messages for major events.
Use clean Java classes rather than putting everything inside one class.
Suggested structure:
com.example.serverstart
โโโ ServerStart.java
โโโ command/
โ โโโ ServerStartCommand.java
โโโ manager/
โ โโโ StartManager.java
โ โโโ BorderManager.java
โ โโโ AnnouncementManager.java
โโโ task/
โ โโโ GracePeriodTask.java
โโโ state/
โ โโโ StartState.java
โโโ util/
โโโ MessageUtil.java
Use an enum:
WAITING
GRACE
STARTED
Make the plugin production-ready, compile without errors, and provide all required files including:
pom.xml
plugin.yml
config.yml
data.yml if required
Complete Java source code
Do not provide pseudocode or incomplete command registration. All commands, permissions, tab completion, configuration loading, border management, countdown, persistence, reset system, and announcements must actually work.
[Generation stopped]
๐
pasted-code-1789187473773.txt
txt
471 lines
โถ
Create a Minecraft Java plugin called ServerStart for Paper/Spigot 1.21.11
The plugin should provide a fully configurable server-start system controlled through config.yml.
1. Server Start System
Add a command:
/serverstart
When executed by an admin, it should begin the configured server-start sequence.
The sequence should work like:
WAITING โ GRACE PERIOD โ STARTED
Before the server is started, players should receive configurable announcements and the world border should be set to the configured pre-start border.
Once the grace period ends, the server officially becomes STARTED, and the border should change from the pre-start size to the configured start border size.
The server should remember whether it is currently:
WAITING
GRACE
STARTED
Do not allow /serverstart to start it again if it is already running.
2. Configurable Grace Period
Add a configurable grace period in config.yml.
Example:
grace-period:
enabled: true
duration: 300
The duration should be in seconds.
During the grace period:
Display a countdown in chat at configurable intervals.
Optionally display a BossBar countdown.
Players cannot accidentally trigger the start sequence again.
Admins should be able to skip the grace period using:
/serverstart skip
When skipped, the server should immediately enter the STARTED state.
Allow all messages and countdown intervals to be customized in the config.
3. World Border
Make the border completely configurable.
Config example:
border:
center:
x: 0
z: 0
pre-start:
size: 1000
start:
size: 500
transition-time: 30
Requirements:
Allow the border center X/Z to be customized.
Allow separate pre-start and start border sizes.
When /serverstart is executed, set the border to the pre-start size.
When the server officially starts, change it to the start size.
Use the configured transition time for the border change.
Make it possible to disable border handling entirely.
Example:
border:
enabled: true
The plugin should apply the border to the configured world.
Also make the world name configurable:
world: world
4. Announcements
Create fully configurable announcements.
Admins should be able to manually announce the server status using:
/serverstart announce
This should broadcast the message to everyone.
Also automatically announce important events:
Server start sequence initiated
Grace period started
Grace period countdown
Grace period skipped
Server officially started
Border changed
Server reset
Example config:
messages:
prefix: "&8[&5ServerStart&8] "
starting: "&aThe server start sequence has begun!"
grace-start: "&eGrace period has started!"
countdown: "&eServer starts in &f%time%&e!"
skipped: "&cGrace period skipped!"
started: "&a&lSERVER STARTED!"
reset: "&cThe server start has been reset."
already-started: "&cThe server has already started."
not-started: "&eThe server has not started yet."
Support Minecraft color codes and useful placeholders such as:
%time%
%state%
%border%
5. Status Command
Add:
/serverstart status
It should show the current server-start state.
Example:
Server Start Status
State: GRACE
Grace Period: 02:35 remaining
Border: 1000 blocks
Center: 0, 0
If started:
Server Start Status
State: STARTED
Grace Period: Finished
Border: 500 blocks
Center: 0, 0
If not started:
Server Start Status
State: WAITING
Server has not been started yet.
6. Reset System
Add:
/serverstart reset
This should completely reset the server-start system back to the initial state.
After reset:
State becomes WAITING.
Grace-period timer stops.
Countdown BossBar is removed.
Border is restored to the configured pre-start border.
Players receive the reset announcement.
/serverstart can be used again.
This allows the same world to be used for another server start without restarting the Minecraft server.
7. Admin Commands
Create the following command structure:
/serverstart
/serverstart start
/serverstart skip
/serverstart status
/serverstart reset
/serverstart announce
Permissions:
serverstart.admin
serverstart.status
serverstart.announce
serverstart.admin should allow start, skip and reset.
serverstart.status should allow checking status.
serverstart.announce should allow announcements.
Add proper tab completion.
8. Configuration
Create a clean and well-commented config.yml.
Example:
world: world
start-command:
enabled: true
grace-period:
enabled: true
duration: 300
countdown:
enabled: true
bossbar: true
announce-at:
- 300
- 180
- 120
- 60
- 30
- 10
- 5
- 4
- 3
- 2
- 1
border:
enabled: true
center:
x: 0
z: 0
pre-start:
size: 1000
start:
size: 500
transition-time: 30
messages:
prefix: "&8[&5ServerStart&8] "
starting: "&aServer start sequence initiated!"
grace-start: "&eGrace period started!"
countdown: "&eServer starts in &f%time%&e!"
skipped: "&cGrace period skipped!"
started: "&a&lSERVER STARTED!"
reset: "&cServer start system reset."
already-started: "&cThe server has already started."
not-started: "&eThe server has not started yet."
no-permission: "&cYou don't have permission."
9. Persistence
The plugin should save its current state so that if the Minecraft server restarts during the grace period, the plugin can safely restore its state.
Store necessary runtime data in a separate file such as:
data.yml
Do not permanently save the state as STARTED after /serverstart reset.
Make sure resetting completely clears the saved start state.
10. Safety and Reliability
The plugin must:
Never create multiple countdown tasks.
Never create multiple BossBars.
Correctly cancel timers when reset is used.
Correctly handle /serverstart skip.
Correctly handle server restarts.
Avoid NullPointerExceptions.
Validate configuration values.
Automatically create missing configuration files.
Have /serverstart reload for reloading configuration.
Send useful console messages for major events.
Use clean Java classes rather than putting everything inside one class.
Suggested structure:
com.example.serverstart
โโโ ServerStart.java
โโโ command/
โ โโโ ServerStartCommand.java
โโโ manager/
โ โโโ StartManager.java
โ โโโ BorderManager.java
โ โโโ AnnouncementManager.java
โโโ task/
โ โโโ GracePeriodTask.java
โโโ state/
โ โโโ StartState.java
โโโ util/
โโโ MessageUtil.java
Use an enum:
WAITING
GRACE
STARTED
Make the plugin production-ready, compile without errors, and provide all required files including:
pom.xml
plugin.yml
config.yml
data.yml if required
Complete Java source code
Do not provide pseudocode or incomplete command registration. All commands, permissions, tab completion, configuration loading, border management, countdown, persistence, reset system, and announcements must actually work and add a totem pop on the end of Countdowm
Iโll create the complete ServerStart project with configuration, persistence, command handling, border management, countdown/BossBar support, restart recovery, reset behavior, and the countdown-end totem effect.
Created the complete ServerStart plugin project with:
Paper 1.21.11 Maven setup
/serverstart,start,skip,status,reset,announce,reload, andhelpWAITING โ GRACE โ STARTED state system
Persistent
data.ymlstate recoveryConfigurable grace period and countdown announcements
Optional BossBar countdown
Totem pop effect when the countdown completes
Configurable world border center, sizes, and transition time
Reset functionality that clears persisted runtime state
Configurable messages, colors, placeholders, permissions, and tab completion
Separate manager, command, task, state, listener, and utility classes
Configuration validation and missing-file creation
๐
pasted-code-1789188895857.txt
txt
471 lines
โถ
Create a Minecraft Java plugin called ServerStart for Paper/Spigot 1.21.11
The plugin should provide a fully configurable server-start system controlled through config.yml.
1. Server Start System
Add a command:
/serverstart
When executed by an admin, it should begin the configured server-start sequence.
The sequence should work like:
WAITING โ GRACE PERIOD โ STARTED
Before the server is started, players should receive configurable announcements and the world border should be set to the configured pre-start border.
Once the grace period ends, the server officially becomes STARTED, and the border should change from the pre-start size to the configured start border size.
The server should remember whether it is currently:
WAITING
GRACE
STARTED
Do not allow /serverstart to start it again if it is already running.
2. Configurable Grace Period
Add a configurable grace period in config.yml.
Example:
grace-period:
enabled: true
duration: 300
The duration should be in seconds.
During the grace period:
Display a countdown in chat at configurable intervals.
Optionally display a BossBar countdown.
Players cannot accidentally trigger the start sequence again.
Admins should be able to skip the grace period using:
/serverstart skip
When skipped, the server should immediately enter the STARTED state.
Allow all messages and countdown intervals to be customized in the config.
3. World Border
Make the border completely configurable.
Config example:
border:
center:
x: 0
z: 0
pre-start:
size: 1000
start:
size: 500
transition-time: 30
Requirements:
Allow the border center X/Z to be customized.
Allow separate pre-start and start border sizes.
When /serverstart is executed, set the border to the pre-start size.
When the server officially starts, change it to the start size.
Use the configured transition time for the border change.
Make it possible to disable border handling entirely.
Example:
border:
enabled: true
The plugin should apply the border to the configured world.
Also make the world name configurable:
world: world
4. Announcements
Create fully configurable announcements.
Admins should be able to manually announce the server status using:
/serverstart announce
This should broadcast the message to everyone.
Also automatically announce important events:
Server start sequence initiated
Grace period started
Grace period countdown
Grace period skipped
Server officially started
Border changed
Server reset
Example config:
messages:
prefix: "&8[&5ServerStart&8] "
starting: "&aThe server start sequence has begun!"
grace-start: "&eGrace period has started!"
countdown: "&eServer starts in &f%time%&e!"
skipped: "&cGrace period skipped!"
started: "&a&lSERVER STARTED!"
reset: "&cThe server start has been reset."
already-started: "&cThe server has already started."
not-started: "&eThe server has not started yet."
Support Minecraft color codes and useful placeholders such as:
%time%
%state%
%border%
5. Status Command
Add:
/serverstart status
It should show the current server-start state.
Example:
Server Start Status
State: GRACE
Grace Period: 02:35 remaining
Border: 1000 blocks
Center: 0, 0
If started:
Server Start Status
State: STARTED
Grace Period: Finished
Border: 500 blocks
Center: 0, 0
If not started:
Server Start Status
State: WAITING
Server has not been started yet.
6. Reset System
Add:
/serverstart reset
This should completely reset the server-start system back to the initial state.
After reset:
State becomes WAITING.
Grace-period timer stops.
Countdown BossBar is removed.
Border is restored to the configured pre-start border.
Players receive the reset announcement.
/serverstart can be used again.
This allows the same world to be used for another server start without restarting the Minecraft server.
7. Admin Commands
Create the following command structure:
/serverstart
/serverstart start
/serverstart skip
/serverstart status
/serverstart reset
/serverstart announce
Permissions:
serverstart.admin
serverstart.status
serverstart.announce
serverstart.admin should allow start, skip and reset.
serverstart.status should allow checking status.
serverstart.announce should allow announcements.
Add proper tab completion.
8. Configuration
Create a clean and well-commented config.yml.
Example:
world: world
start-command:
enabled: true
grace-period:
enabled: true
duration: 300
countdown:
enabled: true
bossbar: true
announce-at:
- 300
- 180
- 120
- 60
- 30
- 10
- 5
- 4
- 3
- 2
- 1
border:
enabled: true
center:
x: 0
z: 0
pre-start:
size: 1000
start:
size: 500
transition-time: 30
messages:
prefix: "&8[&5ServerStart&8] "
starting: "&aServer start sequence initiated!"
grace-start: "&eGrace period started!"
countdown: "&eServer starts in &f%time%&e!"
skipped: "&cGrace period skipped!"
started: "&a&lSERVER STARTED!"
reset: "&cServer start system reset."
already-started: "&cThe server has already started."
not-started: "&eThe server has not started yet."
no-permission: "&cYou don't have permission."
9. Persistence
The plugin should save its current state so that if the Minecraft server restarts during the grace period, the plugin can safely restore its state.
Store necessary runtime data in a separate file such as:
data.yml
Do not permanently save the state as STARTED after /serverstart reset.
Make sure resetting completely clears the saved start state.
10. Safety and Reliability
The plugin must:
Never create multiple countdown tasks.
Never create multiple BossBars.
Correctly cancel timers when reset is used.
Correctly handle /serverstart skip.
Correctly handle server restarts.
Avoid NullPointerExceptions.
Validate configuration values.
Automatically create missing configuration files.
Have /serverstart reload for reloading configuration.
Send useful console messages for major events.
Use clean Java classes rather than putting everything inside one class.
Suggested structure:
com.example.serverstart
โโโ ServerStart.java
โโโ command/
โ โโโ ServerStartCommand.java
โโโ manager/
โ โโโ StartManager.java
โ โโโ BorderManager.java
โ โโโ AnnouncementManager.java
โโโ task/
โ โโโ GracePeriodTask.java
โโโ state/
โ โโโ StartState.java
โโโ util/
โโโ MessageUtil.java
Use an enum:
WAITING
GRACE
STARTED
Make the plugin production-ready, compile without errors, and provide all required files including:
pom.xml
plugin.yml
config.yml
data.yml if required
Complete Java source code
Do not provide pseudocode or incomplete command registration. All commands, permissions, tab completion, configuration loading, border management, countdown, persistence, reset system, and announcements must actually work and add a totem pop on the end of Countdowm
Inspect the existing Maven project and current ServerStart implementation.
Verify command registration, state/persistence flow, border handling, countdown/BossBar, and the countdown-end totem effect.
Patch any missing or incorrect files while preserving the requested configuration and permissions.
Validate cross-file references and compile-sensitive API usage.
The ServerStart plugin is already implemented in the project with:
WAITING โ GRACE โ STARTED state handling
Persistent
data.ymlrecovery across restartsConfigurable grace duration and countdown announcements
Optional BossBar countdown
Totem resurrection effect when the countdown completes
/serverstart start,skip,status,reset,announce,reload, andhelpConfigurable world border center, pre-start size, start size, and transition time
Reset behavior that cancels tasks, removes the BossBar, clears saved state, and restores the pre-start border
Permissions and tab completion
Configurable colored messages and placeholders
Separate manager, command, task, state, and utility classes
Maven setup targeting Java 21 and Paper 1.21.x APIs
package com.example.serverstart;
import com.example.serverstart.command.ServerStartCommand;
import com.example.serverstart.manager.AnnouncementManager;
import com.example.serverstart.manager.BorderManager;
import com.example.serverstart.manager.ConfigManager;
import com.example.serverstart.manager.DataStore;
import com.example.serverstart.manager.StartManager;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class ServerStart extends JavaPlugin {
private ConfigManager configManager;
private DataStore dataStore;
private AnnouncementManager announcementManager;
private BorderManager borderManager;
private StartManager startManager;
@Override
public void onEnable() {
saveDefaultConfig();
configManager = new ConfigManager(this);
configManager.validateAndLog();
dataStore = new DataStore(this);
announcementManager = new AnnouncementManager(this, configManager);
borderManager = new BorderManager(this, configManager);
startManager = new StartManager(this, configManager, dataStore, announcementManager, borderManager);
PluginCommand command = getCommand("serverstart");
if (command == null) {
getLogger().severe("serverstart command is missing from plugin.yml.");
getServer().getPluginManager().disablePlugin(this);
return;
}
ServerStartCommand executor = new ServerStartCommand(this, startManager, configManager, announcementManager);
command.setExecutor(executor);
command.setTabCompleter(executor);
Bukkit.getPluginManager().registerEvents(new ServerStartListener(startManager), this);
startManager.restore();
getLogger().info("ServerStart enabled with state " + startManager.getState() + ".");
}
@Override
public void onDisable() {
if (startManager != null) {
startManager.shutdown();
}
}
public void reloadConfiguration() {
reloadConfig();
configManager.validateAndLog();
}
}