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!

Here is a nice function to search packets for the one you want:
code_language.skript:
function packetSearch(s: string):
  loop packettypes:
    if "%loop-value%" contains {_s}:
      broadcast "%loop-value%"
 
  • Like
Reactions: Tlatoani
Hello,
I do not understand this error :/
3a6349eee8.png
 
Hey this seems not to work?

maby am i seeing something wrong here.

code_language.skript:
command /offhandhit:
    trigger:
        set {_} to new play_server_animation packet
        set int pnum 0 of {_} to 1
        send player packet {_}
 
Hey this seems not to work?

maby am i seeing something wrong here.

code_language.skript:
command /offhandhit:
    trigger:
        set {_} to new play_server_animation packet
        set int pnum 0 of {_} to 1
        send player packet {_}
When you're doing an animation packet, you don't want to just send the packet to the player doing the animation. Instead, you need to set the player in the packet and send it to all players you want to see the packet.

code_language.skript:
command /offhandhit:
    trigger:
        set {_packet} to new play_server_animation packet
        set player's world pentity 0 of {_packet} to player
        set int pnum 1 of {_packet} to 1
        loop all players:
            send loop-layer packet {_packet}
 
  • Like
Reactions: BrettPlayMC
When you're doing an animation packet, you don't want to just send the packet to the player doing the animation. Instead, you need to set the player in the packet and send it to all players you want to see the packet.

code_language.skript:
command /offhandhit:
    trigger:
        set {_packet} to new play_server_animation packet
        set player's world pentity 0 of {_packet} to player
        set int pnum 1 of {_packet} to 1
        loop all players:
            send loop-layer packet {_packet}

Thx it seems to work but not what i want?

3f02f5ca90991f8ca3ada299ecb3d77f.png


This should be the right animation to move the offhand right. but all i recieve is a damage effect?
 
Thx it seems to work but not what i want?

3f02f5ca90991f8ca3ada299ecb3d77f.png


This should be the right animation to move the offhand right. but all i recieve is a damage effect?
That's a client packet, not a server packet (because it is being sent by client, not server). I'm not sure which packet this is referring to, it may be play_client_arm_animation but I'm not sure. Anyways, to make a player send a packet to the server, you need to use this effect:
code_language.skript:
receive packet %packet% from %player%
 
I'm just starting to get decent at packets, but I have a lot of trouble when a type on wiki.vg doesn't directly match up with a syntax. I've managed to decipher some of the fields for the packet I'm trying to work with, but need help with a couple of them. Here's an annotated image of what I have so far...
SLUCns9.png

Could you help me fill in the blanks, and check what I have so far? Thanks.

EDIT: If you need to test things this is the
code_language.skript:
play_server_spawn_entity_living
packet
 
I'm just starting to get decent at packets, but I have a lot of trouble when a type on wiki.vg doesn't directly match up with a syntax. I've managed to decipher some of the fields for the packet I'm trying to work with, but need help with a couple of them. Here's an annotated image of what I have so far...
SLUCns9.png

Could you help me fill in the blanks, and check what I have so far? Thanks.

EDIT: If you need to test things this is the
code_language.skript:
play_server_spawn_entity_living
packet
All of what you have so far should be right.

The UUID isn't added yet, but if I remember I'll add it tomorrow in a new beta.

The angles seem to be all byte pnum according to PacketWrapper.

The Entity Metadata is a "datawatcher" pjson (you have to have at least a recent beta for this one). Unfortunately I just realized there is a bug in this one that I'll have to fix tomorrow as well, but the basics of it is that you get a jsonobject that has an entity at the key "entity" which you need to keep when you set it again, as well as a few "index keys" (all numbers of course) that represent certain metadata key/values.
 
All of what you have so far should be right.

The UUID isn't added yet, but if I remember I'll add it tomorrow in a new beta.

The angles seem to be all byte pnum according to PacketWrapper.

The Entity Metadata is a "datawatcher" pjson (you have to have at least a recent beta for this one). Unfortunately I just realized there is a bug in this one that I'll have to fix tomorrow as well, but the basics of it is that you get a jsonobject that has an entity at the key "entity" which you need to keep when you set it again, as well as a few "index keys" (all numbers of course) that represent certain metadata key/values.
Thanks a bunch, I'll be watching the github
 
  • Like
Reactions: Tlatoani
The new beta with the uuid and the datawatcher fix is out (MundoSK 1.7.5-BETA.7.154: https://github.com/MundoSK/MundoSK/blob/749a91f8d131756d5bb1169abaa5462e33299a4b/MundoSK.jar). The uuid is just a string and uses the syntax
code_language.skript:
"uuid" pinfo %number% of %packet%
Thanks for the update. I think this broke some things... Here's a couple photos
gH6O9op.png

yA1ffXl.png

The last error also happens with this code:
code_language.skript:
on packet event play_server_spawn_entity_living:
  broadcast "%""uuid"" pinfo 1 of event-packet%"