#Text.of questions

33 messages · Page 1 of 1 (latest)

sly stream
#

So, three questions regarding this text.of stuff. How exactly do I send it to the player? With something like event.server.tell()? And can I restrict some parts of the message with if statements? And can I do linebreaks?
Thanks in advance

languid martenBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

sharp knoll
#

What are you trying to do?

#

You can use Text.of() in many places(tooltips, item names etc)

sly stream
#

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?

sharp knoll
#

event.server.getPlayers()

#

is Internal.EntityArrayList

rich steeple
sly stream
sharp knoll
#

ah yes event.server.players also

#

i forgor about beans

sly stream
#

And about the text stuff?

sharp knoll
#
  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

sly stream
#

Ok

#

Thanks

#

Last thing: how can I print a part of the text only if an if statement is true?

sly stream
#

And is it possible to clear the chat?

sharp knoll
#

hmm i don't know about that

sharp knoll
#

you can just use strings you don't have to use Text.of()

sly stream
#

How do you mean?

sly stream
#

Another thing, is it possible to put item icons into the text.of?

sharp knoll
#

yes minecraft allows unicode characters

sharp knoll
sly stream
sly stream
sleek hare
sly stream
#

Yeah I already understood that after I wrote the message, thanks