MundoSK Packets

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

I'm trying to understand, how exactly I should write this line, what field to modify (for example string pinfo 0 of {_packet}), how is it called and what to feed into it, should it be plain text, or list varible or some kind of json.

I also kept testing what fields are sent when you create, remove team and when you add someone. This is what I got with MundoSK when I tested if there is a field at all: string pinfo 0,1,2,3,4,5 were present, int pnum 0,1,2 present, string array pinfo = none of these in packet, other types of data are also absent.
Hi, do you know the code to set the name of a scoreboard from "on packet event play_server_scoreboard_display_objective:" in a var ?
i had try some %string% with "Name, Score Name, ..." with no result. I have only the position of the scoreboard (=sidebar)
exemple : set {_n::*} to "name" pinfo 0 of event-packet
I try to fix a multi addon conflict with scoreboard. thx :emoji_grinning:
 
Hi, do you know the code to set the name of a scoreboard from "on packet event play_server_scoreboard_display_objective:" in a var ?
i had try some %string% with "Name, Score Name, ..." with no result. I have only the position of the scoreboard (=sidebar)
exemple : set {_n::*} to "name" pinfo 0 of event-packet
I try to fix a multi addon conflict with scoreboard. thx :emoji_grinning:

I don't know exact code, but I suggest you send desired packet to player and broadcast its fields. Way I found most of needed fields was like this using MundoSK:

code_language.skript:
on packet event play_server_entity_metadata:
    pinfo 0 %pinfo 0 of event-packet%"
    broadcast "int pnum 0 %int pnum 0 of event-packet%"
    broadcast "byte pnum 0 %byte pnum 0 of event-packet%"
    broadcast "byte pnum 1 %byte pnum 1 of event-packet%"
    broadcast "byte pnum 2 %byte pnum 2 of event-packet%"
    broadcast "byte pnum 3 %byte pnum 3 of event-packet%"
    broadcast "byte pnum 4 %byte pnum 4 of event-packet%"
    broadcast "byte pnum 5 %byte pnum 5 of event-packet%"

And like this, using Skellett:

code_language.skript:
on packet:
    if event-string is "PacketPlayOutEntityMetadata":
        set {_a} to packet field "a"
        set {_b} to packet field "b"
        set {_c} to packet field "c"
        set {_d} to packet field "d"
        set {_e} to packet field "e"
        set {_f} to packet field "f"
        set {_g} to packet field "g"
        set {_h} to packet field "h"
        broadcast "A:%{_a}% B:%{_b}% C:%{_c}% D:%{_d}% E:%{_e}% F:%{_f}% G:%{_g}% H:%{_h}%

You can then set {_var} to packet field "X", if you know desired field is "X". Or you can write me scoreboard command that will send desired packet to player, so I can read it for you.
 
I don't know exact code, but I suggest you send desired packet to player and broadcast its fields. Way I found most of needed fields was like this using MundoSK:

code_language.skript:
on packet event play_server_entity_metadata:
    pinfo 0 %pinfo 0 of event-packet%"
    broadcast "int pnum 0 %int pnum 0 of event-packet%"
    broadcast "byte pnum 0 %byte pnum 0 of event-packet%"
    broadcast "byte pnum 1 %byte pnum 1 of event-packet%"
    broadcast "byte pnum 2 %byte pnum 2 of event-packet%"
    broadcast "byte pnum 3 %byte pnum 3 of event-packet%"
    broadcast "byte pnum 4 %byte pnum 4 of event-packet%"
    broadcast "byte pnum 5 %byte pnum 5 of event-packet%"

And like this, using Skellett:

code_language.skript:
on packet:
    if event-string is "PacketPlayOutEntityMetadata":
        set {_a} to packet field "a"
        set {_b} to packet field "b"
        set {_c} to packet field "c"
        set {_d} to packet field "d"
        set {_e} to packet field "e"
        set {_f} to packet field "f"
        set {_g} to packet field "g"
        set {_h} to packet field "h"
        broadcast "A:%{_a}% B:%{_b}% C:%{_c}% D:%{_d}% E:%{_e}% F:%{_f}% G:%{_g}% H:%{_h}%

You can then set {_var} to packet field "X", if you know desired field is "X". Or you can write me scoreboard command that will send desired packet to player, so I can read it for you.
code_language.skript:
on packet:
  event-string is "PacketPlayOutEntityMetadata"
  loop split "abcdefghijklmnopqrstuvwxyz" at "":
    add "%loop-value%: %packet field loop-value%" to {_l::*}
  broadcast {_l::*}
if you'd like it more concise, but mundosk packets are better
 
code_language.skript:
on packet:
  event-string is "PacketPlayOutEntityMetadata"
  loop split "abcdefghijklmnopqrstuvwxyz" at "":
    add "%loop-value%: %packet field loop-value%" to {_l::*}
  broadcast {_l::*}
if you'd like it more concise
Splitting it that way adds a space in the list. And knowing LimeGlass, that might thow a NPE if the field doesn't exist.
 
Splitting it that way adds a space in the list. And knowing LimeGlass, that might thow a NPE if the field doesn't exist.
code_language.skript:
on packet:
  event-string is "PacketPlayOutEntityMetadata"
  loop split "abcdefghijklmnopqrstuvwxyz" at "" where [string input is not " "]:
    add "%loop-value%: %packet field loop-value%" to {_l::*}
  broadcast {_l::*}
then
 
I don't know exact code, but I suggest you send desired packet to player and broadcast its fields. Way I found most of needed fields was like this using MundoSK:

code_language.skript:
on packet event play_server_entity_metadata:
    pinfo 0 %pinfo 0 of event-packet%"
    broadcast "int pnum 0 %int pnum 0 of event-packet%"
    broadcast "byte pnum 0 %byte pnum 0 of event-packet%"
    broadcast "byte pnum 1 %byte pnum 1 of event-packet%"
    broadcast "byte pnum 2 %byte pnum 2 of event-packet%"
    broadcast "byte pnum 3 %byte pnum 3 of event-packet%"
    broadcast "byte pnum 4 %byte pnum 4 of event-packet%"
    broadcast "byte pnum 5 %byte pnum 5 of event-packet%"

And like this, using Skellett:

code_language.skript:
on packet:
    if event-string is "PacketPlayOutEntityMetadata":
        set {_a} to packet field "a"
        set {_b} to packet field "b"
        set {_c} to packet field "c"
        set {_d} to packet field "d"
        set {_e} to packet field "e"
        set {_f} to packet field "f"
        set {_g} to packet field "g"
        set {_h} to packet field "h"
        broadcast "A:%{_a}% B:%{_b}% C:%{_c}% D:%{_d}% E:%{_e}% F:%{_f}% G:%{_g}% H:%{_h}%

You can then set {_var} to packet field "X", if you know desired field is "X". Or you can write me scoreboard command that will send desired packet to player, so I can read it for you.


Hi, this is great (but "on packet" is broken for me, i use MundoSK so it's not a problem)
Sorry, in fact I had a correct code from the beginning but the identifier of the scoreboard was "sidebar" so I thought I had wrong. I am stupid ^^

Here is the code to do scoreboard client side without addon as Umbaska (with color and spacebar support):


code_language.skript:
#on packet event play_server_scoreboard_objective:
#    broadcast "<cyan>%string pinfo 0 of event-packet%"
#    broadcast "<yellow>%string pinfo 1 of event-packet%"
#    set string pinfo 1 of event-packet to "test"
on packet event play_server_scoreboard_score:
    #broadcast "<yellow>%string pinfo 0 of event-packet%"
    #broadcast "<white>%string pinfo 1 of event-packet%"
    set {_text} to string pinfo 0 of event-packet
    replace all "_" with " " in {_text}
    set string pinfo 0 of event-packet to "%{_text}%"
on packet event play_server_scoreboard_display_objective:
    #broadcast "int pnum 0 <yellow>%int pnum 0 of event-packet%"
    #broadcast "<cyan>%string pinfo 0 of event-packet%"
    #broadcast "%event-player%"
    if  "%string pinfo 0 of event-packet%" does not contain "%event-player%":
        cancel event

function ScoreboardCreate(p: player, name: string):
    execute console command "/scoreboard objectives add %{_p}% dummy %{_name}%"
    execute console command "/scoreboard objectives setdisplay sidebar %{_p}%"
function ScoreboardReset(p: player):   
    execute console command "/scoreboard objectives remove %{_p}%"
function ScoreboardSet(p: player, id: number, text: string):
    replace all " " with "_" in {_text}
    execute console command "/scoreboard players set %{_text}% %{_p}% %{_id}%"
 
convert this to skript

Code:
for (Player p : Bukkit.getOnlinePlayers())
         {
           PacketPlayOutEntityEffect eff = new PacketPlayOutEntityEffect(p.getPlayer().getEntityId(), new MobEffect(MobEffectList.fromId(24), 10, 1, true, true));
           ((CraftPlayer) p).getHandle().playerConnection.sendPacket(eff);
         }
 
convert this to skript

Code:
for (Player p : Bukkit.getOnlinePlayers())
         {
           PacketPlayOutEntityEffect eff = new PacketPlayOutEntityEffect(p.getPlayer().getEntityId(), new MobEffect(MobEffectList.fromId(24), 10, 1, true, true));
           ((CraftPlayer) p).getHandle().playerConnection.sendPacket(eff);
         }
Most of us are using script because we don’t know java. What does that do?
 
What do you need to make this work on 1.14? I have skript version 2.3.7 AAnd It gives me this beautiful error:
Code:
 can't understand this event: 'on packet' (Chairs.sk, line 22: on packet:')
MundoSK will not work for packets on 1.14, but the developer kindly shared with me snapshot of his upcoming addon ProtocolSK, you may ask him in discord to share it with you as well. It works perfectly so far.
 
Hello, I would need help with a packet. (spigot 1.8.8)
play_client_block_dig, i have location pinfo 0 of event-packet but I'm not that :emoji_frowning::
 
Last edited:
Hello, I would need help with a packet. (spigot 1.8.8)
play_client_block_dig, i have location pinfo 0 of event-packet but I'm not that :emoji_frowning::
Not sure exactly what you're asking, but the first one is int pnum 0 of event-packet and the last one is byte pnum 0 of event-packet.