Skip to content

Add a config option to customize the click debounce delay #274

@WarnDa

Description

@WarnDa

Hello,

Could the current hardcoded 75ms click debounce delay be made configurable?
From what I saw in the source, DeluxeMenus currently uses a hardcoded 75ms cache to prevent repeated clicks:

expireAfterWrite(75, TimeUnit.MILLISECONDS)

This works fine for basic menu interactions, but it can be too short for shop menus where commands need to check a placeholder-based balance, remove currency/items from the player, refresh the menu, then give the purchased item/reward.

In some cases, especially when using PlaceholderAPI placeholders or item-based currencies, refreshing the menu after 1 tick is not always enough because the placeholder value may take 2 ticks or more to update correctly.
Because of that, players can sometimes click fast enough to trigger the purchase twice before the updated balance/lore is applied, which can lead to duplicate rewards.

It would be useful to have a config option such as:

menu-click-cooldown-ms: 75

The default value could stay at 75ms to preserve the current behavior, but server owners could increase it to 100ms, 150ms, 250ms, or more depending on their shop setup.
This would be useful for menus that handle purchases directly through DeluxeMenus commands and rely on placeholders or item checks to update after a short delay.

Thanks ! :D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions