Question Adventure/MiniMessage: Translatable with dynamic placeholders?

IzaacB

New member
Apr 10, 2024
1
0
1
Sweden
Hello!
I'm migrating from acf to Adventure/MiniMessage, but I'm hitting roadblock after roadblock.
I really can't figure out how to use Translatable components together with dynamic placeholders...

My plugin has a wide range of placeholders, from static ones like the plugin version, to the player in an event.
The goal is to contain it in a class that handles everything related to Adventure/MiniMessage and the translations, and just provides a function to return a translated component that has had all placeholders replaced, and one function that returns a plain-text variant of the translated component, with all placeholders replaced.

No matter what I've tried, I can't get it to work.
Is there any good examples on how to accomplish this? Tried looking at other plugins (such as BetterMessages) but it seems like using Adventure/MiniMessage, and customize it in any way is overly complex in relation to what you want to do. Is it really that complex to do something like this, if so, I'm going back to acf, even thou I'm trying to use as little dependencies as possible and rely on paper exclusively.

For some background information: My goal is to build somewhat of a framework that makes it really easy for my non-english-speaking 8yo son to experiment with mod development, and as such, I want to reduce any dependencies that isn't explicitly neccessary, and also, I want to learn how to do things myself instead of relying on n plugins/dependencies and hope they all are properly maintained.