Recursive Placeholder Parsing for Chat Messages #9524
Romain-GUILLEMOT
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Currently, CMI processes placeholders in chat messages but does not recursively resolve placeholders that return another placeholder. This can lead to cases where placeholders remain unresolved instead of displaying their final values.
Use Case
In my setup, I use LuckPerms to define a suffix containing a placeholder from ItemAdder.
Example:
%luckperms_suffix% → Returns %img_admin%
%img_admin% → Should resolve to an image/icon
However, when setting %luckperms_suffix% in CMI's chat format, the result is %img_admin% instead of the final resolved value.
Suggested Solution
CMI should support recursive placeholder resolution, meaning that placeholders should be resolved until no further replacements are needed.
Example Behavior
CMI processes %luckperms_suffix% and replaces it with %img_admin%.
CMI detects that %img_admin% is another placeholder and processes it.
The final result is the actual value of %img_admin%.
This would ensure that placeholders can be nested and fully resolved before displaying the final result in chat.
Benefit
Improves compatibility with plugins like LuckPerms, ItemAdder, PlaceholderAPI, etc.
Ensures that chat messages display correctly when placeholders return other placeholders.
Removes the need for manual processing or extra plugin workarounds.
Would it be possible to implement this recursive placeholder parsing in CMI? 😊
Beta Was this translation helpful? Give feedback.
All reactions