#Bukkit - Send a raw message to a player

37 messages · Page 1 of 1 (latest)

smoky spade
#

I want to send [{"text":"hello","color":"#ff5fff"}] to the player (like /tellraw but without having the console execute the command), but I can't find anything on spigot and bukkit forums about it

next frigateBOT
#

This post has been reserved for your question.

Hey @smoky spade! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

next frigateBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

smoky spade
#

.

next frigateBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

fleet mason
#
        public void onSomeEvent(SomeEvent event) {
            Player player = event.getPlayer();
            
            String jsonMessage = "[{\"text\":\"hello\",\"color\":\"#ff5fff\"}]";
            
            BaseComponent[] message = TextComponent.fromLegacyText(jsonMessage);
            player.sendMessage(ChatMessageType.CHAT, message);
        }```

Maybe by making somethig like this it migth work, I've not tested yet so let me know if there is any error
fleet mason
#

if u haven't make it yet

smoky spade
next frigateBOT
# smoky spade Thanks, I'll test it tomorrow

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

fleet mason
next frigateBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.

smoky spade
smoky spade
#

no

fleet mason
#

Can u send me a screenshot of whats happening pls

smoky spade
fleet mason
#

Wait

#

I think its easier than what we though

#

But do you want to send it to all players or only when an event trigger?

smoky spade
#

to a specific user

#

so like he move in a certain zone and it sends the message

fleet mason
#

Okey so why you dont just use chatcolor?

smoky spade
#

can you have custom in chatcolors?

fleet mason
#

Yes you can

#
String msg = net.md_5.bungee.api.ChatColor.of("#FF5FFF") + "hello";
player.sendMessage(msg);```
#

I test it and it worked to me

#

so

#

let me know if it worked 4 u

smoky spade
#

yep

#

works perfectly

#

tysm

fleet mason
#

np