1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Possible bug when using play_server_chat packet with message effect

Discussion in 'Skript' started by TPGamesNL, Aug 23, 2018.

Thread Status:
Not open for further replies.
  1. TPGamesNL

    TPGamesNL Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    1,311
    Likes Received:
    73
    Medals:
    Skript Version: 2.2-dev36
    Skript Author: Bensku
    Minecraft Version: Spigot 1.12.2
    ---
    Full Code:
    Code (Skript):
    1. on packet event play_server_chat:
    2.     set {_t} to "chatcomponent" pjson 0 of event-packet
    3.     send "&ct: %{_t}%" to console
    4.  
    5. command /test:
    6.     trigger:
    7.         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 (Text):
    1. [18:54:50 INFO]: <TPGamesNL> t
    2. [18:54:50 INFO]: t: {"extra":[{"text":"<TPGamesNL> t"}],"text":""}
    3. [18:54:52 INFO]: TPGamesNL issued server command: /test
    4. [18:54:52 INFO]: TPGamesNL [ecf95bdd-5d30-4ddb-a3ec-f491f7cc1f34]: /test
    5. [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 (Skript):
    1. on packet event play_server_chat:
    2.     set {_t} to "chatcomponent" pjson 0 of event-packet
    3.     send "&ct: %{_t}%" to console
    4.  
    5. command /test:
    6.     trigger:
    7.         set {_txt} to "test"
    8.         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.
     
Thread Status:
Not open for further replies.
Loading...