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

Minimessage with open_url action doesn't work correctly #1029

Closed Lemar98 closed 5 months ago

Lemar98 commented 5 months ago

I'm facing a problem.

if I send the player a chat message like this <click:open_url:https://somesite/%value1%:%value2%:%value3%><#76ccab>Click me pls</click> then when the player clicks on this message, a window will open confirming whether he wants to follow the link, but the link will be incorrect! The link in this case is cut off to the following form: https://somesite/value.

I did a little research and realized that the problem is that the link will always be cut off if it encounters a ":" sign somewhere in the endpoint. If I generate this message without using minimessage in the code, then this error no longer occurs.

I think something is not working correctly in minimessages. Correct me if I'm wrong, please.

Joo200 commented 5 months ago

you have to escape the string correctly, try <click:open_url:'https://somesite/%value1%:%value2%:%value3%'><#76ccab>Click me pls</click>

see https://docs.advntr.dev/minimessage/format.html#format for more information about escaping

Lemar98 commented 5 months ago

It's work for me, thank you