Carpet

Carpet

2M Downloads

Format of text is stripped when concatenating two formatted text strings from within Scarpet

James103 opened this issue ยท 4 comments

commented

As of Carpet mod 1.4.20 and MC 1.16.4, if you do something like the following, the result is plain white text:

display_title(player(), 'actionbar', format('gi This should be green italics ') + format('r This should be red'));
commented

thats cos scarpet takes the string value of those two when adding. I agree, there should be a function for that, but idk how well it would work with + operator, cos then would have to add functionality for - and * and / functionalities as well, which wouldnt rly work.
Anyways, format takes more than one argument, so you could just wrap them both in one big format() function and it should print fine. or put both in one format function.

commented

I didn't realize that. This can be closed.

commented

@James103 I havent tested, im not 100% sure. If you test and find that it doesnt work, feel free to reopen.

commented

Well, anyway I added the + operator to FormattedTexts in a PR, cause why not.