corrupted._.double
📎 1 file 3,036 chars
📄
pasted-code-1769637634685.txt
txt 105 lines
▶
Make a Minecraft plugin (Java, Spigot/Paper API) that starts a shrinking world border from an initial size given in the command, and the border must shrink toward the center (the border’s center point stays fixed in the middle while the size decreases).

Core behavior

Add a command that starts the event using:

 = the starting diameter of the border (e.g., 500 means 500x500)

 = seconds between each shrink step

When the command is executed:

Set the world border center to the “middle” of the target world area (center stays constant for the whole event).

Default: center on the executing player’s current X/Z if player runs the command (so it closes on that center).

If run from console: center uses world spawn X/Z or a configurable X/Z in config.yml.

Set the border size to .

Start a repeating task: every  seconds, reduce the border size by a fixed step amount until it reaches the configured minimum/final size, then stop.

Shrink rules

The border must shrink step-by-step:

Use a configurable shrinkStep (e.g., 10 blocks per tick cycle) in config, or allow an optional argument.

Border size must never go below the configured finalSize (minimum).

Once the border reaches finalSize, the plugin:

stops the task

broadcasts a completion message (optional config toggle)

Multi-world support (Multiverse)

The command must support specifying a target world name:

If a world is provided, apply border to that world only.

If not provided, use sender’s current world (if player), otherwise use configurable default world.

Must work on Multiverse servers (multiple worlds loaded/unloaded).

Arclight compatibility

Must work on Arclight by using only Bukkit/Spigot APIs:

scheduling with BukkitScheduler

world borders via World#getWorldBorder()

no NMS or Paper-only features unless optional

Commands & Help

Provide:

/borderclose   [world] (starts shrinking)

/borderclose stop [world] (stops active shrink task)

/borderclose status [world] (shows current size, target size, delay, next tick time)

/borderclose help (shows usage + examples)

Add permissions:

borderclose.use, borderclose.stop, borderclose.status, borderclose.help, borderclose.admin

All commands must return clear error messages for:

invalid numbers

world not found

trying to start when already running (define: restart/deny)

Config & Persistence

config.yml should include:

finalSize (minimum border size)

shrinkStep

default world name

default center behavior (player position vs spawn vs fixed coords)

messages (optional)

Save active task state per world (optional) so the plugin can recover or safely stop on reload.

Output / UX

Broadcast (optional) each shrink step or only on milestones (e.g., every 100 blocks).

Show a bossbar/actionbar (optional) with current size and time to next shrink step.

Log actions to console.

Implement it as a clean, modular plugin (Main, CommandHandler, BorderManager, TaskManager, ConfigManager) with proper plugin.yml and robust validation.
Kodari AI
KodariJan 28 at 10:01 pm 2,178 (v2)

I’ll create a world border shrinking plugin with multi-world support and Arclight compatibility.

BorderClose
A comprehensive world border management plugin that enables automatic border shrinking events. Features include configurable shrink steps, multi-world support compatible with Multiverse, real-time status tracking with boss bars, and persistent task management. The border shrinks toward a fixed center point with customizable delays and minimum size limits. Includes admin commands for starting, stopping, and monitoring shrink events across different worlds.

[Generation stopped]

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 248
src/main/java/com/borderclose/BorderClose.java
package com.borderclose;

import com.borderclose.command.BorderCloseCommand;
import com.borderclose.manager.BorderManager;
import com.borderclose.manager.ConfigManager;
import com.borderclose.manager.DisplayManager;
import com.borderclose.manager.TaskManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class BorderClose extends JavaPlugin {
    private ConfigManager configManager;
    private BorderManager borderManager;
    private TaskManager taskManager;
    private DisplayManager displayManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.borderManager = new BorderManager(this);
        this.taskManager = new TaskManager(this);
        this.displayManager = new DisplayManager(this);

        this.configManager.loadConfig();

        BorderCloseCommand commandExecutor = new BorderCloseCommand(this);
        this.getCommand("borderclose").setExecutor(commandExecutor);
        this.getCommand("borderclose").setTabCompleter(commandExecutor);

        this.getLogger().info("BorderClose has been enabled!");
    }

    @Override
    public void onDisable() {
        this.taskManager.stopAllTasks();
        this.displayManager.clearAllBossBars();
        this.getLogger().info("BorderClose has been disabled!");
    }
}