Possible bug when using play_server_chat packet with message effect

  • 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.

TPGamesNL

Staff member
Moderator
Supporter
Addon Developer
Dev Programme
Jan 20, 2018
1,501
108
63
21
Skript Version: 2.2-dev36
Skript Author: Bensku
Minecraft Version: Spigot 1.12.2
---
Full Code:
code_language.skript:
on packet event play_server_chat:
    set {_t} to "chatcomponent" pjson 0 of event-packet
    send "&ct: %{_t}%" to console

command /test:
    trigger:
        message "test"

Errors on Reload:
None

Other Useful Info:
So I'm trying to make a script that can read messages sent by the server (using the play_server_chat) packet. Most of it works, but for some weird reason whenever I'm sending a message using Skript, it doesn't work. I think this could be a bug. Example: (I do get the 'test' message in chat but it just sends me '<none>' in console)
Code:
[18:54:50 INFO]: <TPGamesNL> t
[18:54:50 INFO]: t: {"extra":[{"text":"<TPGamesNL> t"}],"text":""}
[18:54:52 INFO]: TPGamesNL issued server command: /test
[18:54:52 INFO]: TPGamesNL [ecf95bdd-5d30-4ddb-a3ec-f491f7cc1f34]: /test
[18:54:52 INFO]: t: <none>
But for some reason, whenever I use broadcast instead of message, it does work. Also when I use something like this code:
code_language.skript:
on packet event play_server_chat:
    set {_t} to "chatcomponent" pjson 0 of event-packet
    send "&ct: %{_t}%" to console

command /test:
    trigger:
        set {_txt} to "test"
        message {_txt}
It does work. Does anyone know why this happens?

Addons using (including versions):
MundoSK 1.8.5 (and yes I have ProtocolLib)

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? Well I didn't really know any other methods of fixing it since I just want to edit this little bit of code and I don't want to change every script to set it's message to a local variable and send that instead of sending the message right away.
 
Status
Not open for further replies.