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

Allow mutating tag resolvers in the global MiniMessage instance after creation #1174

Open
5 tasks
kezz opened this issue Mar 5, 2025 · 0 comments
Open
5 tasks

Comments

@kezz
Copy link
Member

kezz commented Mar 5, 2025

It would be nice to allow plugin devs on platforms that provide MiniMessage a way to mutate the tag resolvers available in the global MiniMessage instance.

There are a few steps required before this is achievable:

  • All tags should have a namespace to allow for multiple tags to have the same name (e.g. <adventure:blue> or <myplugin:blue>). See Namespaced TagResolver API #696.
  • We need API to easily allow tag resolvers to be "locked" behind permissions with changing defaults. For example, we might want custom colours to be available to everyone but a money placeholder for admins or console only. Ideally this API would wrap over tags, with the global instance probably checking by default so we don't overcomplicate things.
  • We need the context object to provide an easy way to check against these permissions.
  • We need to allow the user to provide some context that can bypass all permission checks.
  • We need good and clear documentation for both developers and end users! Perhaps with an expansion of the community libraries page to signpost users towards neat new plugins/etc that have placeholders.

We also need to decide on how registration will look. Should it be a one-time startup thing or something that can be done post-initialisation?

We also need to take care not to introduce any crazy exploits. All "global" tags should require name spacing with a key and we should have strict, automatic permission checks by default (with every tag defaulting to requiring the permission to be present). This way we're guarding around devs being stupid by making it double opt-in to get your tag available in the "standard" (i.e. no additional context) calls to the global instance.

@kezz kezz changed the title Allow mutating tag resolvers in the global MiniMssage instance after creation Allow mutating tag resolvers in the global MiniMessage instance after creation Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant