⏲ Stop Cooldown icon

⏲ Stop Cooldown -----

Add cooldown to server shutdown



Commands

Code (Text):
/stop-cooldown <subcommand> [args]

Main command to manage the StopCooldown plugin.
Requires permission:
Code (Text):
stopcooldown.command
Available subcommands:
  • Code (Text):
    help
    — Show help message.
  • Code (Text):
    stop [cooldown]
    — Start a stop with cooldown. (default if omitted)
  • Code (Text):
    cancel
    — Cancel a running cooldown.
  • Code (Text):
    reload
    — Reload plugin config from disk.
  • Code (Text):
    set_cooldown <seconds>
    — Change default stop cooldown.
  • Code (Text):
    set_last_cooldown <seconds>
    — Change delay before force stop if players are still online.
  • Code (Text):
    set_overriding <true|false|player|server>
    — Define how vanilla `/stop` is overridden.
  • Code (Text):
    set_use_title <true|false>
    — Enable/disable use of Minecraft titles.
  • Code (Text):
    set_use_vanilla_stop <true|false>
    — Use vanilla `/stop` instead of `Bukkit.shutdown()`.
  • Code (Text):
    show_running_config
    — Show the current in-memory config.
  • Code (Text):
    show_stored_config
    — Show the contents of `config.yml`.

---

Code (Text):
/stop
(intercepted by StopCooldown depending on configuration)

You can override the vanilla `/stop` behavior. The following variants are available:

  • Code (Text):
    /stop
    — Triggers shutdown with default cooldown.
  • Code (Text):
    /stop <seconds>
    — Triggers shutdown with custom cooldown.
  • Code (Text):
    /stop cancel
    — Cancels the current shutdown (permission:
    Code (Text):
    stopcooldown.cancel
    ).
  • Code (Text):
    /stop reload
    — Reloads plugin config (permission:
    Code (Text):
    stopcooldown.reload
    ).
  • Code (Text):
    /stop now
    — Forces immediate shutdown (not intercepted, fallback for crashes).

You can change this behavior via:
Code (Text):
/stop-cooldown set_overriding <value>
---

Note: If the plugin crashes or the cooldown freezes, use
Code (Text):
/stop now
to bypass safely.

️ Permissions

Each permission defaults to OP.
You can configure them via a permissions plugin (e.g. LuckPerms):

Code (Text):
stopcooldown.command
— Access to `/stop-cooldown`
Code (Text):
stopcooldown.stop
— Run a cooldown-based stop
Code (Text):
stopcooldown.cancel
— Cancel a shutdown
Code (Text):
stopcooldown.reload
— Reload plugin
Code (Text):
stopcooldown.set.cooldown
— Modify default cooldown
Code (Text):
stopcooldown.set.last-cooldown
— Modify fallback cooldown
Code (Text):
stopcooldown.set.overriding
— Change vanilla stop override
Code (Text):
stopcooldown.set.use-title
— Toggle title use
Code (Text):
stopcooldown.set.use-vanilla-stop
— Toggle vanilla stop behavior
Code (Text):
stopcooldown.show.config
— Show configuration

---

API Usage (Java)

Import the API in your plugin:
Code (Java):

import mc.raphaelgf.stopCooldown.API ;
 
Useful methods:

Code (Java):

// Get plugin instance
Plugin plugin = API. getPlugin ( ) ;

// Check if the server is stopping
boolean stopping = API. isStopping ( ) ;

// Get current shutdown status
Status status = API. getStatus ( ) ; // Enum: NONE, STOPPING, STOPPED

// Reload the plugin
API. reloadPlugin ( ) ;

// Change configuration
API. configPlugin ( "cooldown", 60, "use-title", false ) ;

// Set override mode
API. setOverriding (OverrideVanillaCommand. PLAYER ) ;

// Get override mode
OverrideVanillaCommand current = API. getOverriding ( ) ;
 
Important: Always check `API.isAvailable()` before calling other methods to ensure the plugin is active.

---

⚙️ Example config.yml
Located at plugins/StopCooldown/config.yml

Code (YAML):

# Default cooldown before stopping the server (in seconds)
cooldown
: 30

# Final countdown when players are still connected (in seconds)
last-cooldown
: 10

# If a player joins while the stop is in progress and less than X seconds remain, kick them
join-cooldown-limit
: 5

# Show titles to players when countdown is active
use-title
: true

# Use the vanilla /stop command instead of Bukkit.shutdown()
use-vanilla-stop
: false

# Override behavior for the /stop command
# Possible values: true, false, server, player
override-vanilla-command
: true
 
Resource Information
Author:
----------
Total Downloads: 10
First Release: Apr 18, 2025
Last Update: Apr 18, 2025
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings