Skip to content

Better cooldown #47

Closed
Closed

Description

@Ale32bit

Currently, the cooldown system is basic and requires to be explicitly implemented in the command to work (see /rtp).

Describe the solution you'd like
Commands could trigger a pre-run event to determine whether the command is to be executed or fail.

Activity

  1. self-assigned this
    on Jun 20, 2025
  2. scmcgowen commented on Jun 20, 2025

    @scmcgowen

    Maybe also a second event if it is determined to have passed? An example with Solstice economy would be that I'd check balance for command costs and then send a pass, then if all other event subscribers also pass, I'd get an event saying it passed so that I could actually deduct the balance

  3. Ale32bit commented on Jun 20, 2025

    @Ale32bit
    OwnerAuthor

    Maybe also a second event if it is determined to have passed? An example with Solstice economy would be that I'd check balance for command costs and then send a pass, then if all other event subscribers also pass, I'd get an event saying it passed so that I could actually deduct the balance

    I don't know how Solstice Economy handles events, but Fabric offers phases in custom events: https://github.com/FabricMC/fabric/blob/484a6c1a6afbf40b55be159eb9c08277c60f5a68/fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/EventFactory.java#L79-L110

  4. scmcgowen commented on Jun 20, 2025

    @scmcgowen

    Solstice Economy would just be a consumer of the event. I just want to 100% avoid the possibility of someone being charged for a command and then it being blocked by something else later. Having a second event that triggers after success would prevent this since I do the check in the first event, and charge the user in the second

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions