KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
679 stars 104 forks source link

feat(api): replace text in ClickEvent value too #1027

Closed f4n74z14 closed 5 months ago

f4n74z14 commented 5 months ago

Hi! 👋

While developing a plugin, it became necessary for me to replace the text in the ClickEvent value. The test provides a case of using this feature.

I also refactored the code a bit because the function turned out to be very complicated.

zml2008 commented 5 months ago

I agree -- I can see a place for some sort of partially-integrated mechanism so any pure-text replacements can be applied to both click event values and components in the tree, but kezz covered my issues pretty well. See also #236.

(also, please remember when PR'ing to create the PR from a feature branch rather than main/4 -- it makes it easier for us to work with locally). I'm going to close this PR due to the branch issues, but if you want to look at adding separate options to the replacement config, feel free to open another PR from the proper branch.

f4n74z14 commented 5 months ago

Fair enough! I'll have to think about switching to MiniMessage placeholders.