#Bukkit - Send a raw message to a player
37 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @smoky spade! Please use
/closeor theClose Postbutton 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.
💤 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.
.
💤 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.
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
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.
np ^^
💤 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.
Changed the last line with player.spigot().sendMessage(message), but I still receive the json in chat
So it worked?
no
Can u send me a screenshot of whats happening pls
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?
Okey so why you dont just use chatcolor?
Oh okey
not enough colors
can you have custom in chatcolors?
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
np