Register events with a specific priority.
Darkhax opened this issue ยท 0 comments
Describe the feature you'd like
I would like the ability to register event listeners with specific priorities using CTEventManager. The register method currently hardcode the priority to normal. This method does not need to be exposed to scripts but I don't think it would hurt.
Describe alternatives you've considered
There are no alternatives as this is a hardcoded value. For now I am just using a custom method as an alternative.
Additional context
In GameStages I am developing helper methods to simplify scripting common scenarios with CraftTweaker. For example giving the stage to a player when they unlock an advancement or craft a recipe. These helper methods are effectively factories for event listeners which get registered through CTEventManager. I am currently trying to add a helper that will unlock a stage when a player reaches a certain EXP level. The correct time to check the player's level would be during the lowest priority of the LevelChange event, however with CrT I can only do stuff at normal priority.
Minecraft version
1.16