json hover in server chat

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Govindas

Active Member
Feb 5, 2017
82
5
8
I want to make that when you hover on player name in server chat, it will show some specific text, how do I do it? using MundoSK addon with play_server_chat packet.
 
Last edited:
You'll need to cancel the packet event and then send your own message. Much easier would be to use the on chat event like this:
code_language.skript:
on chat:
    cancel event
    json(@a, "%player%||ttp:&7your specific text||: %message%")
Untested but should work. Requires json.sk tho
 
You'll need to cancel the packet event and then send your own message. Much easier would be to use the on chat event like this:
code_language.skript:
on chat:
    cancel event
    json(@a, "%player%||ttp:&7your specific text||: %message%")
Untested but should work. Requires json.sk tho
I do not want to cancel the chat event, how do I do it with packet? I know that this should be possible, I just do not know how to include the json thing.
 
I do not want to cancel the chat event, how do I do it with packet? I know that this should be possible, I just do not know how to include the json thing.
As I said, find out if the message includes a player name, cancel the packet event and send the message again with json.sk and your json
 
As I said, find out if the message includes a player name, cancel the packet event and send the message again with json.sk and your json
I'm editing the packet itself, not cancelling it, I already edited it with multiple things, I just want to include the json in my edited things and I do not know how to do that

my code:

on packet event play_server_chat:
set {_trigger} to "%""chatcomponent"" pjson 0 of event-packet%"
if {_trigger} contains "∶":
loop all players:
replace all "%loop-player%" in {_trigger} with "something"
set "chatcomponent" pjson 0 of event-packet to json of string {_trigger}
this way I detect the chat(there's special chat symbol for easier detection)
 
I'm editing the packet itself, not cancelling it, I already edited it with multiple things, I just want to include the json in my edited things and I do not know how to do that
You need to find out how json looks like in a chat packet and put that into there
 
yup, that is what I'm trying to find and I can't find anywhere, saw a script with that before but that script doesn't exist on skunity.com anymore :emoji_frowning: so can't look at it's code for it
Try logging every chat packet to a file and send yourself a json message
 
code_language.skript:
log "'%{_packet}%'" to "packets.log"
will be in /plugins/Skript/logs/packets.log
got it, looks like this:
'{"hoverEvent":{"action":"show_text","value":"test"},"color":"white","text":"test"}'
but now I'm confused on how do I make that with hovering player name in chat and with all the messages which player said etc to be in.. really confusing for me xD
 
ok I decided to just start cancelling the chat event, I thinked about it and found that it won't really disturb anything and will be just same. the example with on chat event cancelling is incorrect, but I got it to work correctly.
 
ok I decided to just start cancelling the chat event, I thinked about it and found that it won't really disturb anything and will be just same. the example with on chat event cancelling is incorrect, but I got it to work correctly.
Can you post here the result of your code after you end doing it?
 
Can you post here the result of your code after you end doing it?
on chat:
cancel event
{mutes::%uuid of player%::*} is not set
{staffchat::%player%} is not set
{chatmsg2::%player%} is not set
{tempgbotask::%player%} is not set
{partychat::%player%} is not set
{readrules2.%player%} is set
set {_name} to "%display name of player%"
replace "%player%" with "test" in {_name}
json("@a", "%{_name}%||ttp:&cReal name: &e&l%player%||&7∶ &a%message%")
 
on chat:
cancel event
{mutes::%uuid of player%::*} is not set
{staffchat::%player%} is not set
{chatmsg2::%player%} is not set
{tempgbotask::%player%} is not set
{partychat::%player%} is not set
{readrules2.%player%} is set
set {_name} to "%display name of player%"
replace "%player%" with "test" in {_name}
json("@a", "%{_name}%||ttp:&cReal name: &e&l%player%||&7∶ &a%message%")
I think that is skidded from @WheezyGold7931's Mineplex remake script as it looks very similar.
 
it's written 100% by me and never used anyone's other script for that one. I just have made my own party/staff chat systems, mute system, and system where you can't chat without having read rules, so that checks are made in the script.
Well I don't know if the op has all of those variables or things in his server.
 
Status
Not open for further replies.