#Text.of questions
33 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
What are you trying to do?
You can use Text.of() in many places(tooltips, item names etc)
Printing something into the chat
But only for one player
Oh and another thing, is there a way to get all players so I can loop over them and test if they have specific persistant data?
yes
event.server.getPlayers()
is Internal.EntityArrayList
Thanks
And about the text stuff?
server.getPlayers().forEach(p => {
console.log(p.tell(Text.of('bomba')))
})
for example this prints 'bomba' in every players chat
server is event.server obv
Ok
Thanks
Last thing: how can I print a part of the text only if an if statement is true?
And is it possible to clear the chat?
hmm i don't know about that
use ? :
you can just use strings you don't have to use Text.of()
How do you mean?
Another thing, is it possible to put item icons into the text.of?
yes minecraft allows unicode characters
Text.of( *boolean* ? 'true' : 'false' )
Is it also possible with non boolean variables?
How?
Wdym? The first boolean is Just an Logical Expression Like in If Statements and the other two are Just Strings that can be modified
Yeah I already understood that after I wrote the message, thanks
