Skip to content

Added ephemeral cooldowns - #303

Merged
BlitzOffline merged 1 commit into
mainfrom
ephemeral-cooldowns
Aug 8, 2026
Merged

Added ephemeral cooldowns#303
BlitzOffline merged 1 commit into
mainfrom
ephemeral-cooldowns

Conversation

@BlitzOffline

Copy link
Copy Markdown
Member

Adds cooldowns to DeluxeMenus.

Cooldowns are ephemeral: they are kept in memory only. They survive /dm reload, but they are gone when the server stops or the plugin unloads (for example a forced /reload).

To start a cooldown, a new action was added:

click_commands:
  - '[ephemeralcooldown] shop_buy 30'

To check a cooldown, a new requirement was added:

click_requirement:
  requirements:
    not_on_cooldown:
      type: '!has ephemeral cooldown'
      id: 'shop_buy'
      deny_commands:
        - '[message] &cWait &f%deluxemenus_ephemeral_cooldown_shop_buy%&cs.'

Some placeholders were added as well:

%deluxemenus_ephemeral_cooldown_<id>% - seconds left
%deluxemenus_ephemeral_cooldown_millis_<id>% - milliseconds left
%deluxemenus_ephemeral_cooldown_formatted_<id>% - 1h 2m 3s, with 0 values not included
%deluxemenus_has_ephemeral_cooldown_<id>% - boolean
  • Duration is set in seconds, but accepts s, m, h suffixes and fractions: 30, 0.25, 30s, 5m, 1h.
  • New config.yml option max_ephemeral_cooldown_seconds caps how long a cooldown may be set for. Default -1, which means no cap.
  • When a cooldown is set above the max limit, it is capped at the max limit and a WARNING is sent in console.

Closes #94

@BlitzOffline
BlitzOffline merged commit ac91de4 into main Aug 8, 2026
2 checks passed
@BlitzOffline
BlitzOffline deleted the ephemeral-cooldowns branch August 8, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cooldown time

2 participants