Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import:
- java.util.Collections
- org.bukkit.Bukkit
- com.comphenix.protocol.wrappers.EnumWrappers
- com.comphenix.protocol.wrappers.EnumWrappers$NativeGameMode
- com.comphenix.protocol.wrappers.EnumWrappers$PlayerInfoAction
- com.comphenix.protocol.wrappers.PlayerInfoData
- com.comphenix.protocol.wrappers.WrappedChatComponent
- com.comphenix.protocol.wrappers.WrappedGameProfile
- com.comphenix.protocol.wrappers.WrappedSignedProperty
- option nmsver:
- get:
- set {_package} to Bukkit.getServer().getClass().getPackage().getName()
- set {_strlist::*} to split {_package} by "."
- return {_strlist::4}
- function infect(p: player):
- {_p} is online
- {_p} do not have scoreboard tag "zombie"
- add "zombie" to scoreboard tags of {_p}
- changeSkin({_p}, "eyJ0aW1lc3RhbXAiOjE1NDQ0NTk4Mzc4MjMsInByb2ZpbGVJZCI6IjQzYTgzNzNkNjQyOTQ1MTBhOWFhYjMwZjViM2NlYmIzIiwicHJvZmlsZU5hbWUiOiJTa3VsbENsaWVudFNraW42Iiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS84ZDY3NTUzYjMxOGJhMmVlMmI2MjZlOWI5ZGVkM2UxNWExZDBkOGQ5ZjM3MGZmMDNjOThiMzIzZTc4NTczYjlhIn19fQ==", "yUVWH96rIrYzOO4fCeB30pPSsdyaMJHwP0jKPfd+cfp5Bk5uOd5g547ISckhU0bZMWAkKqEeXUY3R1hsW3GJl+OKdTQwkKVhSdWf6AEV0LaTPav8TCd5jF2JVWDlGeXgHTp+TdBZPJIdWT1uuLuY42YdTfMGsywFE0rGljRo97hpMvBhgRcakw6d4friHUfzJy9shVeXW4gF8xZg79DP+WZ32F/IrsgoRU5O2nxM9ZgmjyaLTyO9WKQoMEpcLJl8vAet2NjJ1YH6klOxnqZpjYPebQuyfFb/ZfTfJv+AevccDCqr1T7OEM2u3MTwttcov5KbnhawrHZnVIBio2sTQGFUmzcsmIJht04YWGkQlrvSzQ4+6/Qyzixl4PE3pfbwg3truuJgItstLLbnNKFqa3H/RQam18vKdM8u7lqOomP4fWP4VEhBcIElnfwohy0PRJ+KOA5586WupKD3bxiAViUN4ywj212gyG6ie8KDDfrtC+e3VOWi/Vja+bJEmy2oHUndesySAZhNNMhrRIOYAARrhpcR0Cl8TmTVCYC4ooaKTdowi8cELLBxCnCJElozKUv2jhoWrpL4ZCSAepz85NdiQk2NjSNqgUOKzxf/pLD4iPs9R0+bVipyN8eGTpSzDdAQ4xO8n2nPQbcqfzqlIfY5hPF0S0+gApK68VXBGkA=")
- 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
- 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
- resetSkin({_p})
- 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-coordinate of {_p}
- set double pnum 1 of {_packet::1} to y-coordinate of {_p}
- set double pnum 2 of {_packet::1} to z-coordinate 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-coordinate of {_p2}
- set double pnum 1 of {_packet::1} to y-coordinate of {_p2}
- set double pnum 2 of {_packet::1} to z-coordinate 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%}
- function resetSkin(p: player):
- set {_uuid} to UUID of {_p}
- changeSkin({_p}, {defaultskinvalue::%{_uuid}%}, {defaultskinsignature::%{_uuid}%})
- function changeSkin(p: player, value: string, signature: string):
- set {_gameprofile} to new WrappedGameProfile(UUID of {_p}, name of {_p})
- {_gameprofile}.getProperties().put("textures", new WrappedSignedProperty("textures", {_value}, {_signature}))
- {_p}.getProfile().getProperties().removeAll("textures")
- {_p}.getProfile().getProperties().putAll("textures", {_gameprofile}.getHandle().getProperties().get("textures"))
- updateGameProfile({_p})
- function updateGameProfile(p: player):
- loop all players:
- loop-player is not {_p}
- loop-player can see {_p}
- hide {_p} from loop-player
- reveal {_p} to loop-player
- if vehicle of {_p} is set:
- set {_vehicle} to vehicle of {_p}
- make {_p} dismount
- set {_playerinfodata} to new PlayerInfoData(WrappedGameProfile.fromPlayer({_p}), 0, NativeGameMode.fromBukkit(gamemode of {_p}), WrappedChatComponent.fromText(playerlist name of {_p}))
- set {_removeinfo} to new play_server_player_info packet
- {_removeinfo}.getPlayerInfoAction().write(0, PlayerInfoAction.REMOVE_PLAYER!)
- {_removeinfo}.getPlayerInfoDataLists().write(0, Collections.singletonList({_playerinfodata}))
- set {_addinfo} to new play_server_player_info packet
- {_addinfo}.getPlayerInfoAction().write(0, PlayerInfoAction.ADD_PLAYER!)
- {_addinfo}.getPlayerInfoDataLists().write(0, Collections.singletonList({_playerinfodata}))
- set {_respawn} to new play_server_respawn packet
- set int pnum 0 of {_respawn} to {_p}.getWorld().getEnvironment().getId()
- {_respawn}.getDifficulties().write(0, EnumWrappers.getDifficultyConverter().getSpecific(difficulty of {_p}'s world))
- {_respawn}.getGameModes().write(0, NativeGameMode.fromBukkit(gamemode of {_p}))
- {_respawn}.getWorldTypeModifier().write(0, {_p}.getWorld().getWorldType())
- set {_position} to new play_server_position packet
- set double pnum 0 of {_position} to x-loc of {_p}
- set double pnum 1 of {_position} to y-loc of {_p}
- set double pnum 2 of {_position} to z-loc of {_p}
- set float pnum 0 of {_position} to yaw of {_p}
- set float pnum 1 of {_position} to pitch of {_p}
- set {_op} to new play_server_entity_status packet
- set int pnum 0 of {_op} to id of {_p}
- set byte pnum 0 of {_op} to 24+(Bukkit.getServer().getHandle().getOPs().[net.minecraft.server.{@nmsver}.JsonList]d!.get(UUID of {_p}).a())
- send {_p} packet {_removeinfo}
- send {_p} packet {_addinfo}
- send {_p} packet {_respawn}
- send {_p} packet {_position}
- send {_p} packet {_op}
- {_p}.updateScaledHealth()
- set {_updatehealth} to new play_server_update_health packet
- set float pnum 0 of {_updatehealth} to health of {_p}*2
- set float pnum 1 of {_updatehealth} to {_p}.getSaturation()
- set int pnum 0 of {_updatehealth} to food of {_p}*2
- send {_p} packet {_updatehealth}
- {_p}.updateInventory()
- set selected hotbar slot of {_p} to selected hotbar slot of {_p}
- {_p}.setExp({_p}.getExp())
- {_p}.setTotalExperience({_p}.getTotalExperience())
- set {_p}'s tool to {_p}.getItemInHand()
- set {_p}'s offhand tool to (inventory of {_p}).getItemInOffHand()
- set {_p}'s walk speed to {_p}'s walk speed
- set {_p}'s fly speed to {_p}'s fly speed
- {_vehicle} is set
- wait 1 tick
- make {_p} ride {_vehicle}
- 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 packet event play_server_player_info:
- event-packet.getPlayerInfoAction().read(0) is PlayerInfoAction.ADD_PLAYER!
- set {_oldplayerinfodata} to event-packet.getPlayerInfoDataLists().read(0).get(0)
- set {_gameprofile} to {_oldplayerinfodata}.getProfile()
- set {_player} to player from uuid "%{_gameprofile}.getUUID()%"
- {_player} is set
- set {_value} to (try {_player}.getProfile().getProperties().get("textures").iterator().next()).getValue()
- set {_signature} to (try {_player}.getProfile().getProperties().get("textures").iterator().next()).getSignature()
- {_value} is set
- {_signature} is set
- {_gameprofile}.getProperties().removeAll("textures")
- {_gameprofile}.getProperties().put("textures", new WrappedSignedProperty("textures", {_value}, {_signature}))
- set {_playerinfodata} to new PlayerInfoData({_gameprofile}, {_oldplayerinfodata}.getLatency(), {_oldplayerinfodata}.getGameMode(), {_oldplayerinfodata}.getDisplayName())
- event-packet.getPlayerInfoDataLists().write(0, Collections.singletonList({_playerinfodata}))
- on join:
- set {defaultskinvalue::%UUID of player%} to (try player.getProfile().getProperties().get("textures").iterator().next()).getValue()
- set {defaultskinsignature::%UUID of player%} to (try player.getProfile().getProperties().get("textures").iterator().next()).getSignature()
- 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"
- changeSkin(player, "eyJ0aW1lc3RhbXAiOjE1NDQ0NTk4Mzc4MjMsInByb2ZpbGVJZCI6IjQzYTgzNzNkNjQyOTQ1MTBhOWFhYjMwZjViM2NlYmIzIiwicHJvZmlsZU5hbWUiOiJTa3VsbENsaWVudFNraW42Iiwic2lnbmF0dXJlUmVxdWlyZWQiOnRydWUsInRleHR1cmVzIjp7IlNLSU4iOnsidXJsIjoiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS84ZDY3NTUzYjMxOGJhMmVlMmI2MjZlOWI5ZGVkM2UxNWExZDBkOGQ5ZjM3MGZmMDNjOThiMzIzZTc4NTczYjlhIn19fQ==", "yUVWH96rIrYzOO4fCeB30pPSsdyaMJHwP0jKPfd+cfp5Bk5uOd5g547ISckhU0bZMWAkKqEeXUY3R1hsW3GJl+OKdTQwkKVhSdWf6AEV0LaTPav8TCd5jF2JVWDlGeXgHTp+TdBZPJIdWT1uuLuY42YdTfMGsywFE0rGljRo97hpMvBhgRcakw6d4friHUfzJy9shVeXW4gF8xZg79DP+WZ32F/IrsgoRU5O2nxM9ZgmjyaLTyO9WKQoMEpcLJl8vAet2NjJ1YH6klOxnqZpjYPebQuyfFb/ZfTfJv+AevccDCqr1T7OEM2u3MTwttcov5KbnhawrHZnVIBio2sTQGFUmzcsmIJht04YWGkQlrvSzQ4+6/Qyzixl4PE3pfbwg3truuJgItstLLbnNKFqa3H/RQam18vKdM8u7lqOomP4fWP4VEhBcIElnfwohy0PRJ+KOA5586WupKD3bxiAViUN4ywj212gyG6ie8KDDfrtC+e3VOWi/Vja+bJEmy2oHUndesySAZhNNMhrRIOYAARrhpcR0Cl8TmTVCYC4ooaKTdowi8cELLBxCnCJElozKUv2jhoWrpL4ZCSAepz85NdiQk2NjSNqgUOKzxf/pLD4iPs9R0+bVipyN8eGTpSzDdAQ4xO8n2nPQbcqfzqlIfY5hPF0S0+gApK68VXBGkA=")
Advertisement
Add Comment
Please, Sign In to add comment