Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cooldown time #94

Open
1470429149 opened this issue May 15, 2024 · 1 comment
Open

Add cooldown time #94

1470429149 opened this issue May 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@1470429149
Copy link

I think this is a very necessary feature and we should add a global cooldown
When players use a cheat client, repeatedly clicking on a single menu will take up a lot of server resources.

@BlitzOffline
Copy link
Member

Having cooldowns built into DeluxeMenus is not a bad idea.

Notes:

  • Built-in cooldowns should be ephemeral (persist until the plugin is unloaded)
  • Should be one of the first validations done
  • Should be global, per menu and item
  • Should have a maximum value (suggestion: 3600 seconds / 72000 ticks)
    People who want longer cooldowns should use existing solutions such as MasterCooldowns or temporary permissions.

Temporary solution

How to create cooldowns using MasterCooldowns:

  1. Start by creating a requirement (view/click/open)
requirements:
  cooldown:
    type: string equals
    input: '%mcd_isinactive_COOLDOWN-ID%'
    output: 'Yes'
  deny_commands:
  - '[message] &cTry again in %mcd_left_formatted_COOLDOWN-ID%, you are on cooldown!'
  1. Add the cooldown (e.g. on click)
    [console] mcd add %player_name% COOLDOWN-ID duration

This is not the only way to create cooldowns for DM, temporary permissions being another example.

@BlitzOffline BlitzOffline added the enhancement New feature or request label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants