Intellij doesn't know LiteralText?

Hello, I'm writing a Fabric 1.20.1 mod that displays the number of totems of other players on a server as a hologram above their heads. I also wanted to add a function that tells the player that they have so many totems. I used this code for that:

 player.sendMessage(new LiteralText("You have " + count + "Totems"), false);

However, in this "LiteralText" is underlined in RED – and it doesn't find the import either – (I imported it but it doesn't exist), what can I use instead?

1 vote, average: 1.00 out of 1 (1 rating, 1 votes, rated)
You need to be a registered member to rate this.
Loading...
Subscribe
Notify of
1 Answer
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
regex9
1 year ago

You can of – Use method.

 player.sendMessage(Text.of("You have " + count + "Totems"), false);