Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function infect(p: player):
- {_p} is online
- {_p} do not have scoreboard tag "zombie"
- add "zombie" to scoreboard tags of {_p}
- loop all players:
- scoreboard team "zombie" in scoreboard scoreboard of loop-player is set
- scoreboard do not have entry "%{_p}%" in the team scoreboard team "zombie" in scoreboard scoreboard of loop-player
- scoreboard add entry "%{_p}%" to team scoreboard team "zombie" in scoreboard scoreboard of loop-player
- sendZombiePacket(loop-player, {_p})
- function cure(p: player):
- {_p} is online
- {_p} has scoreboard tag "zombie"
- remove "zombie" from scoreboard tags of {_p}
- loop all players:
- scoreboard team "zombie" in scoreboard scoreboard of loop-player is set
- scoreboard has entry "%{_p}%" in the team scoreboard team "zombie" in scoreboard scoreboard of loop-player
- scoreboard remove entry "%{_p}%" from team scoreboard team "zombie" in scoreboard scoreboard of loop-player
- set {_uuid} to UUID of {_p}
- {datawatcher::%{_uuid}%} is set
- set {_packet::1} to new play_server_named_entity_spawn packet
- set int pnum 0 of {_packet::1} to id of {_p}
- set "UUID" pinfo 0 of {_packet::1} to {_uuid}
- set double pnum 0 of {_packet::1} to x-loc of {_p}
- set double pnum 1 of {_packet::1} to y-loc of {_p}
- set double pnum 2 of {_packet::1} to z-loc of {_p}
- set byte pnum 0 of {_packet::1} to floor(yaw of {_p}*256/360)
- set byte pnum 1 of {_packet::1} to floor(pitch of {_p}*256/360)
- set "DataWatcherModifier" pinfo 0 of {_packet::1} to {datawatcher::%{_uuid}%}
- set {_packet::2} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::2} to id of {_p}
- set "ItemSlots" penum 0 of {_packet::2} to "MAINHAND"
- if tool of {_p} is set:
- set {_mainhand} to tool of {_p}
- set "ItemModifier" pinfo 0 of {_packet::2} to {_mainhand}
- set {_packet::3} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::3} to id of {_p}
- set "ItemSlots" penum 0 of {_packet::3} to "OFFHAND"
- if offhand tool of {_p} is set:
- set {_offhand} to offhand tool of {_p}
- set "ItemModifier" pinfo 0 of {_packet::2} to {_offhand}
- set {_packet::4} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::4} to id of {_p}
- set "ItemSlots" penum 0 of {_packet::4} to "FEET"
- if boots of {_p} is set:
- set {_feet} to boots of {_p}
- set "ItemModifier" pinfo 0 of {_packet::4} to {_feet}
- set {_packet::5} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::5} to id of {_p}
- set "ItemSlots" penum 0 of {_packet::5} to "LEGS"
- if leggings of {_p} is set:
- set {_legs} to leggings of {_p}
- set "ItemModifier" pinfo 0 of {_packet::5} to {_legs}
- set {_packet::6} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::6} to id of {_p}
- set "ItemSlots" penum 0 of {_packet::6} to "CHEST"
- if chestplate of {_p} is set:
- set {_chest} to chestplate of {_p}
- set "ItemModifier" pinfo 0 of {_packet::6} to {_chest}
- set {_packet::7} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::7} to id of {_p}
- set "ItemSlots" penum 0 of {_packet::7} to "HEAD"
- if helmet of {_p} is set:
- set {_head} to helmet of {_p}
- set "ItemModifier" pinfo 0 of {_packet::7} to {_head}
- loop all players:
- loop-player is not {_p}
- loop 7 times:
- send loop-player packet {_packet::%loop-number%}
- function sendZombiePacket(p1: player, p2: player):
- {_p1} is not {_p2}
- set {_packet::1} to new play_server_spawn_entity_living packet
- set int pnum 0 of {_packet::1} to id of {_p2}
- set int pnum 1 of {_packet::1} to 54
- set double pnum 0 of {_packet::1} to x-loc of {_p2}
- set double pnum 1 of {_packet::1} to y-loc of {_p2}
- set double pnum 2 of {_packet::1} to z-loc of {_p2}
- set byte pnum 0 of {_packet::1} to floor(yaw of {_p2}*256/360)
- set byte pnum 1 of {_packet::1} to floor(pitch of {_p2}*256/360)
- set byte pnum 2 of {_packet::1} to floor(yaw of {_p2}*256/360)
- set int pnum 2 of {_packet::1} to x of velocity of {_p2}*8000
- set int pnum 3 of {_packet::1} to y of velocity of {_p2}*8000
- set int pnum 4 of {_packet::1} to z of velocity of {_p2}*8000
- set {_json::2} to "&2&l%{_p2}%"
- set {_json::3} to true
- set "DataWatcher" pjson 0 of {_packet::1} to json from listvar {_json::*}
- set {_packet::2} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::2} to id of {_p2}
- set "ItemSlots" penum 0 of {_packet::2} to "MAINHAND"
- if tool of {_p2} is set:
- set {_mainhand} to tool of {_p2}
- set "ItemModifier" pinfo 0 of {_packet::2} to {_mainhand}
- set {_packet::3} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::3} to id of {_p2}
- set "ItemSlots" penum 0 of {_packet::3} to "OFFHAND"
- if offhand tool of {_p2} is set:
- set {_offhand} to offhand tool of {_p2}
- set "ItemModifier" pinfo 0 of {_packet::2} to {_offhand}
- set {_packet::4} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::4} to id of {_p2}
- set "ItemSlots" penum 0 of {_packet::4} to "FEET"
- if boots of {_p2} is set:
- set {_feet} to boots of {_p2}
- set "ItemModifier" pinfo 0 of {_packet::4} to {_feet}
- set {_packet::5} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::5} to id of {_p2}
- set "ItemSlots" penum 0 of {_packet::5} to "LEGS"
- if leggings of {_p2} is set:
- set {_legs} to leggings of {_p2}
- set "ItemModifier" pinfo 0 of {_packet::5} to {_legs}
- set {_packet::6} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::6} to id of {_p2}
- set "ItemSlots" penum 0 of {_packet::6} to "CHEST"
- if chestplate of {_p2} is set:
- set {_chest} to chestplate of {_p2}
- set "ItemModifier" pinfo 0 of {_packet::6} to {_chest}
- set {_packet::7} to new play_server_entity_equipment packet
- set int pnum 0 of {_packet::7} to id of {_p2}
- set "ItemSlots" penum 0 of {_packet::7} to "HEAD"
- if helmet of {_p2} is set:
- set {_head} to helmet of {_p2}
- set "ItemModifier" pinfo 0 of {_packet::7} to {_head}
- loop 7 times:
- send {_p1} packet {_packet::%loop-number%}
- on packet event play_server_entity_equipment:
- player's world pentity 0 of event-packet is a player
- "ItemSlots" penum 0 of event-packet is "MAINHAND" or "OFFHAND"
- if "ItemSlots" penum 0 of event-packet is "MAINHAND":
- "ItemModifier" pinfo 0 of event-packet is not tool of player's world pentity 0 of event-packet
- set {_item} to tool of player's world pentity 0 of event-packet
- else if "ItemSlots" penum 0 of event-packet is "OFFHAND":
- "ItemModifier" pinfo 0 of event-packet is not offhand tool of player's world pentity 0 of event-packet
- set {_item} to offhand tool of player's world pentity 0 of event-packet
- {_item} is set
- set "ItemModifier" pinfo 0 of event-packet to {_item}
- on packet event play_server_named_entity_spawn:
- player's world pentity 0 of event-packet is a player
- set {datawatcher::%UUID of player's world pentity 0 of event-packet%} to "DataWatcherModifier" pinfo 0 of event-packet
- player's world pentity 0 of event-packet has scoreboard tag "zombie"
- cancel event
- wait 1 tick
- sendZombiePacket(player, player's world pentity 0 of event-packet)
- on join:
- register new scoreboard team "zombie" in scoreboard scoreboard of player if scoreboard team "zombie" in scoreboard scoreboard of player is not set
- set {_team} to scoreboard team "zombie" in scoreboard scoreboard of player
- set scoreboard team prefix of {_team} to "&2&l"
- loop all players:
- loop-player has scoreboard tag "zombie"
- scoreboard do not have entry "%loop-player%" in the team scoreboard team "zombie" in scoreboard scoreboard of player
- scoreboard add entry "%loop-player%" to team scoreboard team "zombie" in scoreboard scoreboard of player
- player has scoreboard tag "zombie"
Advertisement
Add Comment
Please, Sign In to add comment