Cooldown
Set cooldown limits on item clicks to prevent rapid interaction, command spam, and server load spikes.
Configuration Styles
1. Shorthand (Duration Only)
menu-items:
- slot: 13
material: ENDER_PEARL
name: "&aSpawn Teleport"
cooldown: 5s # 5 second cooldown
command: "/spawn"
2. Full Section Configuration
menu-items:
- slot: 13
material: ENDER_PEARL
name: "&aSpawn Teleport"
cooldown:
duration: 10s # Cooldown duration (e.g. 500ms, 10s, 1m)
bypass-permission: "myserver.cooldown.bypass" # Permission to bypass cooldown (any node name)
message: "&cPlease wait {remaining}s before using this again." # Rejection message
key: "global_teleport" # Shared cooldown group key
command: "/spawn"
Cooldown Properties
| Key | Type | Default | Description |
|---|---|---|---|
duration | Duration | Required | Cooldown duration (units in the table below). 0 or a negative value is an error (invalid-cooldown). |
bypass-permission | Text | None | Players holding this permission node are exempt from the cooldown. You choose the node name; EasyMenu does not register it, so grant it with your permissions plugin. |
message | Text | Localized message | Message sent when clicked during cooldown. {remaining} expands remaining seconds. |
key | Text | None | Shared group identifier across elements. |
Writing Durations
A duration is a number followed by a unit. Units are case-insensitive.
| Unit | Meaning | Example |
|---|---|---|
ms | Milliseconds | 500ms |
s | Seconds | 5s |
m | Minutes | 2m |
h | Hours | 1h |
t | Ticks (1 tick = 50 ms) | 40t |
| Plain integer | Seconds | 5 (same as 5s) |
Decimals such as 1.5s are not allowed; write 1500ms instead. The same syntax is used by the duration of delay and potion-effect.
Shared Cooldown Groups (key)
By default, cooldowns are isolated to player + menu + element.
Setting a key allows multiple elements to share a single cooldown timer:
menu-items:
# Spawn warp
- slot: 11
material: COMPASS
name: "&aWarp Spawn"
cooldown:
duration: 30s
key: "teleport_cooldown" # Shared key
command: "/spawn"
# Lobby warp
- slot: 15
material: NETHER_STAR
name: "&bWarp Lobby"
cooldown:
duration: 30s
key: "teleport_cooldown" # Shared key
command: "/lobby"
After using the Spawn warp, the Lobby warp is also placed on cooldown for 30 seconds.
With a shared key, the cooldown scope is "player + key". Menu and item no longer matter, so items in different menus can share one cooldown.
A player's cooldowns are discarded when they leave the server. /menu reload does not clear cooldowns.
Consumption Timing & Abuse Prevention
EasyMenu 7 consumes the cooldown timer immediately after conditions pass and before actions start (ON_ATTEMPT).
Even if an action fails or player chat input is cancelled, the cooldown remains consumed. This prevents exploiters from bypassing cooldowns by repeatedly cancelling prompts.