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!

Hello, i'm trying to create a citizen with per players skin, it's possible with packets?
 
Hello! Nice addon!
Im trying to solve a java bug on the 1.10.2, the problem is in the ride effect. When a player make a entity ride him it doesn't shown for the client. But for the others users shows. I read some forums and the problem can be solved in the packets that the server sends. But i dont find out wich packet i have to use and how. Im pretty new in this -packets stuff-.Could you help me? Thanks!
 
Hello! Nice addon!
Im trying to solve a java bug on the 1.10.2, the problem is in the ride effect. When a player make a entity ride him it doesn't shown for the client. But for the others users shows. I read some forums and the problem can be solved in the packets that the server sends. But i dont find out wich packet i have to use and how. Im pretty new in this -packets stuff-.Could you help me? Thanks!
You can find some lists of packets at the end of the tutorial under the title “Helpful Resources”. I can’t seem to find forum threads talking about the bug you are describing so it would be good if you could send some links to these threads so I can help you further.
 
Hello I need Help... I am Trying to make the player getting a demo screen... Its a
Change Game State packet with reason 5. How do i write this in skript?
 
Hello I need Help... I am Trying to make the player getting a demo screen... Its a
Change Game State packet with reason 5. How do i write this in skript?
This should be approximately what you need:
code_language.skript:
set {_packet} to new play_server_game_state_change packet
set int pnum 0 of {_packet} to 7 #This might be byte instead of int, not sure
set float pnum 0 of {_packet} to 0 #There are other possible values depending on what you want to show [URL]http://wiki.vg/Protocol#Change_Game_State[/URL]
send {_packet} to {_player}
 
Hello everyone I need help with my script.

What I need: send following packets to player
- scoreboard team created
- scoreboard option showFriendlyInvisibles
- scoreboard team join of attacker (event player)
- scoreboard team join of victim by uuid or id (can be other player or mob)
- potion effect of invisibility applied to victim
- scoreboard team remove

Why packets?
I've created script that allows players to pick up and throw mobs at each other. I want to make mobs half-transparent like ghosts for player that holds mob. Visible to other players so they be aware that this player might attack them, but half-transparent to current player, so he could aim better. And ghost so he doesn't forget that he holds someone. So I think I should use packets for this reason. Another reason, when using actual scoreboard team entities won't attack friendly player. In the end it should look like this:

What I got so far?
Thanks to help of Tlatoani, I've managed to make this parts of script which should work okay:

Scoreboard team create
code_language.skript:
set {_team_add} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_add} to 0 # mode = team create
set string pinfo 0 of {_team_add} to "%attacker%" # team name
send packet {_team_add} to attacker

Scoreboard team option - seeFriendlyInvisibles
code_language.skript:
set {_team_option} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_option} to 2 # team update
set string pinfo 0 of {_team_option} to "%attacker%" # team name
set int pnum 2 of {_team_option} to 2 # seeFriendlyInvisibles
send packet {_team_option} to attacker

Scoreboard team remove
code_language.skript:
set {_team_remove} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_remove} to 1 # mode = team remove
set string pinfo 0 of {_team_remove} to "%player%" # team name
send packet {_team_remove} to player

What I'm failing at?
Scoreboard team join of entity by uuid. You see, I got code above by tracking actual scoreboards, using things like:
code_language.skript:
on packet event play_server_scoreboard_team:
    broadcast "%int pnum 0 of event-packet%"
I matched every value and field with table from packetwrapper, to know what I send to player. But I can not find uuids or ids of entities being added to team. I assume it should be like "something array pinfo 0 of event-packet" to track it, since it's ListString, but how exactly to put it - I can't understand.

Also, how do I add and remove potion effect from another entity?
 
Hello everyone I need help with my script.

What I need: send following packets to player
- scoreboard team created
- scoreboard option showFriendlyInvisibles
- scoreboard team join of attacker (event player)
- scoreboard team join of victim by uuid or id (can be other player or mob)
- potion effect of invisibility applied to victim
- scoreboard team remove

Why packets?
I've created script that allows players to pick up and throw mobs at each other. I want to make mobs half-transparent like ghosts for player that holds mob. Visible to other players so they be aware that this player might attack them, but half-transparent to current player, so he could aim better. And ghost so he doesn't forget that he holds someone. So I think I should use packets for this reason. Another reason, when using actual scoreboard team entities won't attack friendly player. In the end it should look like this:

What I got so far?
Thanks to help of Tlatoani, I've managed to make this parts of script which should work okay:

Scoreboard team create
code_language.skript:
set {_team_add} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_add} to 0 # mode = team create
set string pinfo 0 of {_team_add} to "%attacker%" # team name
send packet {_team_add} to attacker

Scoreboard team option - seeFriendlyInvisibles
code_language.skript:
set {_team_option} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_option} to 2 # team update
set string pinfo 0 of {_team_option} to "%attacker%" # team name
set int pnum 2 of {_team_option} to 2 # seeFriendlyInvisibles
send packet {_team_option} to attacker
this is the relevant wiki.vg

Scoreboard team remove
code_language.skript:
set {_team_remove} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_remove} to 1 # mode = team remove
set string pinfo 0 of {_team_remove} to "%player%" # team name
send packet {_team_remove} to player

What I'm failing at?
Scoreboard team join of entity by uuid. You see, I got code above by tracking actual scoreboards, using things like:
code_language.skript:
on packet event play_server_scoreboard_team:
    broadcast "%int pnum 0 of event-packet%"
I matched every value and field with table from packetwrapper, to know what I send to player. But I can not find uuids or ids of entities being added to team. I assume it should be like "something array pinfo 0 of event-packet" to track it, since it's ListString, but how exactly to put it - I can't understand.

Also, how do I add and remove potion effect from another entity?
This is the packet you want:
PUo3HQ7.png

it's the string array.
 
like wiki.vg says, for players its the player name
Yea, this part I get, player name or uuid of entity, but is this proper way?
code_language.skript:
set {_team_join_a} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_join_a} to 3 # team add players
set string pinfo 0 of {_team_join_a} to "%attacker%" # team name
set string array pinfo 0 of {_team_join_a} to "%attacker%" # player to add
send packet {_team_join_a} to attacker

set {_team_join_v} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_join_v} to 3 # team add players
set string pinfo 0 of {_team_join_v} to "%attacker%" # team name
set string array pinfo 0 of {_team_join_v} to "%entity uuid of victim%" # entity to add
send packet {_team_join_v} to attacker

As I see no effect in game. And packet tracker shows packets fields being sent - mode of packet (create team, remove team, add entities) but <none> in string array pinfo 0 of event-packet, no uuids or ids or names.
 
Yea, this part I get, player name or uuid of entity, but is this proper way?
code_language.skript:
set {_team_join_a} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_join_a} to 3 # team add players
set string pinfo 0 of {_team_join_a} to "%attacker%" # team name
set string array pinfo 0 of {_team_join_a} to "%attacker%" # player to add
send packet {_team_join_a} to attacker

set {_team_join_v} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_join_v} to 3 # team add players
set string pinfo 0 of {_team_join_v} to "%attacker%" # team name
set string array pinfo 0 of {_team_join_v} to "%entity uuid of victim%" # entity to add
send packet {_team_join_v} to attacker

As I see no effect in game. And packet tracker shows packets fields being sent - mode of packet (create team, remove team, add entities) but <none> in string array pinfo 0 of event-packet, no uuids or ids or names.
Nowhere does it say player name or uuid of entity, it says player name for players and uuid for other entities
 
Nowhere does it say player name or uuid of entity, it says player name for players and uuid for other entities
Hm.. In this script there is check that attacker is always player, and by writing "%attacker%" I'm telling player's name. "%entity uuid of victim%" is skellett's expression, and in my tests I'm hitting sheeps and cows, so it should work, as it is working with regular scoreboards via "execute console command..." (my video). So is my code correct, assuming it's always name for player and always uuid for mobs? Coz I see no effect (regular potion effect applied to mob, and since packet is telling that we are in same team, it should be ghost?)
 
Hm.. In this script there is check that attacker is always player, and by writing "%attacker%" I'm telling player's name. "%entity uuid of victim%" is skellett's expression, and in my tests I'm hitting sheeps and cows, so it should work, as it is working with regular scoreboards via "execute console command..." (my video). So is my code correct, assuming it's always name for player and always uuid for mobs? Coz I see no effect (regular potion effect applied to mob, and since packet is telling that we are in same team, it should be ghost?)
You're passing the string array the wrong info. read the notes for it or read what i said above
 
You're passing the string array the wrong info. read the notes for it or read what i said above
I could find no examples of working with string arrays and this is the very first time I need it, as I'm no java programmer or something. Do I need to pay you to get exact working code? How about, I put 5USD on your paypal and you give me code that I can copy-paste which would (1) add player and mob-entity to same team, (2) give mob-entity invisibility for given time so it can be seen as ghost only for event-player (and normal to others), (3) then remove team and (4) remove effect from entity?
 
I could find no examples of working with string arrays and this is the very first time I need it, as I'm no java programmer or something. Do I need to pay you to get exact working code? How about, I put 5USD on your paypal and you give me code that I can copy-paste which would (1) add player and mob-entity to same team, (2) give mob-entity invisibility for given time so it can be seen as ghost only for event-player (and normal to others), (3) then remove team and (4) remove effect from entity?
I'm good. You don't need to know Java either. As far as I can tell the only issue is your passing the wrong thing. You can ignore the fact it's a string array because that isn't relevant, you're just putting into the wrong input. if you look at the wiki.vg description it explains the input you need (I'm assuming the victim is a player).
 
I'm good. You don't need to know Java either. As far as I can tell the only issue is your passing the wrong thing. You can ignore the fact it's a string array because that isn't relevant, you're just putting into the wrong input. if you look at the wiki.vg description it explains the input you need (I'm assuming the victim is a player).
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.

Then I thought to try out Skelletts syntax to display fields, and got this: A = team name, B = team display name, E = nameTagVisibility, F = collisionRule, H = list of players to add to the team that looks like this [player1, player2] which also may contain mob uuids, I = mode (create,remove,update teams, add players), J = options (like seeFriendlyInvisibles). But skellett (as far as I know) only reacts to actual packets that were send, and can not send them manualy.
[doublepost=1509665150,1509660557][/doublepost]Just to sum it up. Thanks to Snow-Pyon it works. What exactly helped me:

code_language.skript:
set {_team_join} to new play_server_scoreboard_team packet
set int pnum 1 of {_team_join} to 3 # team add players
set string pinfo 0 of {_team_join} to "%{_teamname}%"
set collection array pinfo 0 of {_team_join} to "%attacker%", "%entity uuid of victim%"
send packet {_team_join} to attacker
This line in particular:
set collection array pinfo 0 of {_packet} to "player1", "player2"
which I could not find anywhere. Many thanks to Snow-Pyon for this :emoji_grinning: