Build a standalone Bukkit/Paper Minecraft plugin named StoneSMPGracePeriod implementing configurable grace time. Requirements: (1) Grace duration setting in the generated/default config; automatically start grace on server startup when configured enabled. (2) Admin command to start/restart grace with an optional duration argument, stop grace, and show status/remaining time. Protect command with a dedicated permission and provide tab completion/help as appropriate. (3) During grace, cancel PvP damage to players from other players, including indirect projectile damage by resolving Projectile shooter; do not cancel self-damage or unrelated non-player damage. Also provide a config option to protect players from hostile mob damage during grace, default false. Do not implement raiding/griefing protections. (4) Show a global BossBar countdown with human-readable remaining time to all online players, update once per second, add/remove players on join/quit, and remove/hide it when grace ends. Keep timer and UI correct on command start/stop and startup. (5) Use this project's generated framework/API/version and follow its conventions. Inspect existing files first, add appropriate plugin metadata, command and config defaults, and implement complete minimal code. Do not build/claim verification; compilation is handled separately.

Kodari AI
KodariOct 15 at 9:12 am 1
StoneSMPGracePeriod
Implements a configurable grace period system for SMP servers. Features automatic grace activation on server startup with configurable duration and enabled state. Admin commands allow starting, stopping, and checking grace status with optional duration overrides. During grace, PvP damage is cancelled including projectile-based attacks, with configurable hostile mob protection. A global BossBar displays remaining time to all online players, updating every second and syncing with player joins/quits. Grace state persists correctly across command operations and server restarts.
  1. Identify the project’s generated framework, Java/version target, and plugin conventions.

  2. Add the plugin entry point, metadata, command, and configurable grace-period countdown.

Created StoneSMPGracePeriod as a standalone Paper 1.20.4 / Java 17 plugin; the project had no existing framework or version configuration to follow.

  • Grace starts on server startup by default, with a configurable 600-second duration.

  • /graceperiod start [seconds] (alias /grace) starts or restarts grace; /graceperiod stop and /graceperiod status manage and report it.

  • The admin permission is stonesmpgraceperiod.admin (operator by default).

  • A global BossBar counts down and is hidden when grace ends. Grace blocks damage from other players, including their projectiles, while preserving self-damage. Hostile mob protection is configurable and off by default.

  • Added Gradle setup, plugin metadata, and default configuration.

Update the existing StoneSMPGracePeriod plugin so every player-facing chat message it sends has the server prefix [StoneSMP] at the beginning. I inspected the current implementation: GracePeriodCommand.java contains all sender.sendMessage(...) calls for permission denial, invalid duration, status, start/stop, and help/usage messages. Ensure every branch and dynamically composed message is prefixed exactly once, using a small helper if helpful; don't prefix tab completions or BossBar text (they are not chat). Do not change command behavior, permission, or grace logic. Inspect files and implement the complete change only. Do not build or claim verification.

Kodari AI
KodariOct 15 at 9:14 am 1

Plan:

  1. Add a single [StoneSMP] chat-message helper.

  2. Route all command replies through it; leave tab completions and BossBar text untouched.

Updated GracePeriodCommand so all player-facing command messages—including help, errors, status, and start/stop replies—use the [StoneSMP] prefix exactly once. Tab completions and BossBar text are unchanged.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
7 397
src/main/java/com/stonesmp/graceperiod/StoneSMPGracePeriod.java
package com.stonesmp.graceperiod;

import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class StoneSMPGracePeriod extends JavaPlugin {
    private GracePeriodManager gracePeriodManager;

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

        gracePeriodManager = new GracePeriodManager(
                this,
                getConfig().getBoolean("grace.protect-from-hostile-mob-damage", false)
        );
        Bukkit.getPluginManager().registerEvents(gracePeriodManager, this);

        long defaultDuration = getConfig().getLong("grace.duration-seconds", 600L);
        if (defaultDuration <= 0) {
            defaultDuration = 600L;
            getLogger().warning("grace.duration-seconds must be positive; using 600 seconds.");
        }

        PluginCommand command = getCommand("graceperiod");
        if (command == null) {
            throw new IllegalStateException("The graceperiod command is missing from plugin.yml.");
        }
        GracePeriodCommand executor = new GracePeriodCommand(gracePeriodManager, defaultDuration);
        command.setExecutor(executor);
        command.setTabCompleter(executor);

        if (getConfig().getBoolean("grace.enabled", true)
                && !gracePeriodManager.start(defaultDuration)) {
            getLogger().warning("Could not start the configured grace period duration.");
        }
    }

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