DisguiseMe 1.2.sk

Created by Phe0X

Other available versions. Ordered by newest to oldest versions:

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

#This script works from minecraft 1.8 up to minecraft 1.16
#You can contact me on Spigot/SkUnity/Github or Discord (Phe0X#5907) if you find any bug or need help
#Addons needed are ThatPacketAddon, ProtocolLib and Skript-mirror(or skript-reflect)
#You can customize the name of each mob below, you just have to modify the options
#For example, if you want to call the Armorstand "Stand", just change "Armorstand" by "Stand"
#When you'll use /disguise Armorstand, it won't work anymore, instead you will have to use the command /disguise Stand

#If you are a dev and you want some function to disguise some players for others, check this https://phe0x.fr/DisguiseMe/Functions.html/ or the code


#Special thanks to Rush²Fer (He helped me to put the name of player above a disguise, because ThatPacketAddon can't take OptionalChat), to Anarchick (helped me to show the stuff in 1.16) and to CarloDrift (Discovered some bugs and gave some ideas)
options:
	Name: true #Name of the disguised player above its disguise
	#⚠ Don't work on some entities that can't be renamed such as the Armorstand
	#[Doesn't seem to work with Kosmos in 1.15.2 idk why]

	UpdateStuff: true #Show the stuff of the player when he disguises on supported mobs (Zombies or Skeletons for instance) 

	UpdateHead: true #Make have the right yaw when he comes into visible range
	
	SkinReload: true #Reload the skin when the player remove his disguise (otherwise capes, hats.. don't show up)
	#⚠ This bug occurs only in 1.15 or 1.16, if you're not in 1.15 or above this option won't do anything
	
	JoinDelay: 1.5 seconds #Useful only from 1.9 to 1.11, time during which after connection the player is not disguised (necessary otherwise the player becomes invisible when he connects)
	#!!!Modify at your own risk, can make the players near the disguised crash when he connects!!!
	#It works with 1 seconds, but test on your own server
		
	#You can modify the names, but only after the ":" (not before)
	
	ArmorStand: ArmorStand
	Bat: Bat
	Bee: Bee
	Blaze: Blaze
	Cat: Cat
	Cave_Spider: CaveSpider
	Chicken: Chicken
	Cod: Cod
	Cow: Cow
	Creeper: Creeper
	Donkey: Donkey
	Dolphin: Dolphin
	Drowned: Drowned
	Elder_Guardian: ElderGuardian
	Ender_Dragon: EnderDragon
	Enderman: Enderman
	Endermite: Endermite
	Evoker: Evoker
	Fox: Fox
	Ghast: Ghast
	Giant: Giant
	Guardian: Guardian
	Hoglin: Hoglin
	Horse: Horse
	Husk: Husk
	Illusioner: Illusioner
	Iron_Golem: IronGolem
	Llama: Llama
	Magma_Cube: MagmaCube
	Mule: Mule
	Mooshroom: Mooshroom
	Ocelot: Ocelot
	Panda: Panda
	Parrot: Parrot
	Phantom: Phantom
	Pig: Pig
	Piglin: Piglin
	Piglin_Brute: PiglinBrute
	PufferFish: PufferFish
	Polar_Bear: PolarBear
	Rabbit: Rabbit
	Ravager: Ravager
	Salmon: Salmon
	Sheep: Sheep
	Shulker: Shulker
	SilverFish: SilverFish
	Skeleton: Skeleton
	Skeleton_Horse: SkeletonHorse
	Slime: Slime
	Snow_Golem: SnowGolem
	Spider: Spider
	Squid: Squid
	Stray: Stray
	Strider: Strider
	Trader_Llama: TraderLlama
	Tropical_Fish: TropicalFish
	Turtle: Turtle
	Vex: Vex
	Villager: Villager
	Vindicator: Vindicator
	Pillager: Pillager
	Wandering_Trader: WanderingTrader
	Witch: Witch
	Wither: Wither
	Wither_Skeleton: WitherSkeleton
	Wolf: Wolf
	Zoglin: Zoglin
	Zombie: Zombie
	Zombie_Horse: ZombieHorse
	Zombie_Pigman: ZombiePigman
	Zombie_Villager: ZombieVillager
	Zombified_Piglin: ZombifiedPiglin
	
option ver:
	get:
		return console.getServer().getClass().getPackage().getName().split("\.")[3] #Nms version
import: #mandatory to have a name above the disguise, since TPA doesn't have optional chat things (so I must use protocollib & mirror)
	java.util.Optional 
	net.minecraft.server.{@ver}.ChatComponentText
	com.comphenix.protocol.wrappers.WrappedDataWatcher 
	com.comphenix.protocol.wrappers.WrappedDataWatcher$Registry as DWReg
	com.comphenix.protocol.wrappers.WrappedDataWatcher$WrappedDataWatcherObject as DWObject
	java.util.ArrayList #1.16 client side equipment 
	com.comphenix.protocol.wrappers.EnumWrappers$ItemSlot
	com.comphenix.protocol.wrappers.Pair
on load: #Plugins & Settings that could create problems
	set {_mc::*} to minecraft version split at "."
	set {_mc::2} to {_mc::2} parsed as an integer
	set {DM::MCVersion} to {_mc::2}
	if {_mc::2} is 16:
		set {_mc::3} to {_mc::3} parsed as an integer
		set {DM::MCSubVersion} to {_mc::3}
	loop all players:
		loop-player is op
		add loop-player to {_sendto::*}
	add console to {_sendto::*}
	set {_pluginlist::*} to ...server.getServer().getPluginManager().getPlugins()
	if {_pluginlist::*} contains "ViaVersion" or "ViaBackwards" or "ProtocolSupport" or "ViaRewind": #Send a message if a plugin that can change the way packets work is on the server
		send "&6DisguiseMe &b> &6DisguiseMe &b> &4!!! You have a plugin that can change minecraft's protocol &d(ViaVersion, ViaBackwards, ViaRewind, ProtocolSupport..), &4this script may not work as intended !!!" to console #I send that only to console since it's likely that it won't break anything
	set {_list::*} to "ProtocolLib" and "ThatPacketAddon"
	loop {_list::*}:
		{_pluginlist::*} is set
		if "%{_pluginlist::*}%" does not contain "%loop-value%": #send a message if a plugin is missing
			add loop-value to {_missing::*}
	loop {_pluginlist::*}:
		if  "%loop-value%" contains "ProtocolLib":
			set {_ver} to loop-value.getDescription().getVersion()
			set {_ver::*} to {_ver} split at "."
			set {_finalverPlib} to {_ver::2} parsed as a number
		if "%loop-value%" contains "Skript":
			"%loop-value%" doesn't contain "reflect" or "mirror" #we never know
			{DM::MCVersion} is 8
			set {_verSkript} to loop-value.getDescription().getVersion()
			if {_verSkript} contains "2.2" or "2.1.2":
				set {_oldSkript} to true #To use later, the version may be overwritten if another plugin is called Skript
	if {_finalverPlib} <= 5:
		if {DM::MCVersion} <= 15:
			if {DM::MCVersion} <= 11:
				send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}
				send "&6DisguiseMe &b> " to {_sendto::*}
				send "&6DisguiseMe &b> " to {_sendto::*}
				send "&6DisguiseMe &b> &cYou'll get errors when reloading the script but please ignore them" to {_sendto::*}
				if {DM::MCVersion} is 8:
					if {_oldSkript} is true:
						send "&6DisguiseMe &b> &3This script uses functionnality of ProtocolLib 4.6 for MC 1.16, however, you're using ProtocolLib %{_ver}%. It also uses new features of Skript (for offhand in 1.9+)" to {_sendto::*}
						send "&6DisguiseMe &b> &3Sadly, ProtocolLib 4.6 is still in beta and after my tests, doesn't work yet in 1.11 and below but if you wish to, you can download the latest version of Skript for 1.8(a fork) to remove 2 errors: https://github.com/Matocolotoe/Skript-1.8/releases" to {_sendto::*}
						send "&6DisguiseMe &b> &3If you wish to remove the 8 errors, put a quote (##) at the begginig of those lines:" to {_sendto::*}
						send "&6DisguiseMe &b> &3Lines: 661, 665, 669, 673, 677, 680, 681 and 714" to {_sendto::*}
						send "&6DisguiseMe &b> " to {_sendto::*}
						send "&6DisguiseMe &b> " to {_sendto::*}
						send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}	
						set {_msgpass} to true
				{_msgpass} isn't true
				send "&6DisguiseMe &b> &3This script uses functionnality of ProtocolLib 4.6 for MC 1.16, however, you're using ProtocolLib %{_ver}%" to {_sendto::*}
				send "&6DisguiseMe &b> &3Sadly, ProtocolLib 4.6 is still in beta and after my tests, doesn't work yet in 1.11 and below" to {_sendto::*}
				send "&6DisguiseMe &b> &3If you wish to remove the 6 errors, put a quote (##) at the begginig of those lines:" to {_sendto::*}
				send "&6DisguiseMe &b> &3Lines: 661, 665, 669, 673, 677, and 681" to {_sendto::*}
				send "&6DisguiseMe &b> " to {_sendto::*}
				send "&6DisguiseMe &b> " to {_sendto::*}
				send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}	
			if {DM::MCVersion} > 11:
				send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}
				send "&6DisguiseMe &b> " to {_sendto::*}
				send "&6DisguiseMe &b> " to {_sendto::*}
				send "&6DisguiseMe &b> &cProtocolLib isn't up to date" to {_sendto::*}
				send "&6DisguiseMe &b> &3You may encounter errors when reloading, but they can be safely ignored" to {_sendto::*}
				send "&6DisguiseMe &b> &3 You can download ProtocolLib 4.6(may still be in beta) to fix this !" to {_sendto::*}
				send "&6DisguiseMe &b> " to {_sendto::*}
				send "&6DisguiseMe &b> " to {_sendto::*}
				send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}	
		if {DM::MCVersion} >= 16:
			send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}
			send "&6DisguiseMe &b> " to {_sendto::*}
			send "&6DisguiseMe &b> " to {_sendto::*}
			send "&6DisguiseMe &b> &cProtocolLib isn't up to date" to {_sendto::*}
			send "&6DisguiseMe &b> &4You may encounter severe bugs & errors and Updatestuff function won't work" to {_sendto::*}
			send "&6DisguiseMe &b> &4Download ProtocolLib 4.6(may still be in beta but stable according to my tests) to fix this !" to {_sendto::*}
			send "&6DisguiseMe &b> " to {_sendto::*}
			send "&6DisguiseMe &b> " to {_sendto::*}
			send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}
	if {_finalverPlib} >= 6:
		"%{_ver}%" contains "SNAPSHOT" or "beta" or "alpha" #it's snapshot iirc but we never know 
		if {DM::MCVersion} <= 11:
			send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}
			send "&6DisguiseMe &b> " to {_sendto::*}
			send "&6DisguiseMe &b> " to {_sendto::*}
			send "&6DisguiseMe &b> &cYou're not using a stable version of ProtocolLib !" to {_sendto::*}
			send "&6DisguiseMe &b> &4According to my last test, the disguise may not work with an unstable version of ProtocolLib 4.6 !" to {_sendto::*}
			send "&6DisguiseMe &b> &4If something doesn't work, please try using an older (and stable) version of ProtocolLib such as 4.5.1" to {_sendto::*}
			send "&6DisguiseMe &b> " to {_sendto::*}
			send "&6DisguiseMe &b> " to {_sendto::*}
			send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}
	if {_missing::*} is set:
		send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}
		send "&6DisguiseMe &b> " to {_sendto::*}
		send "&6DisguiseMe &b> " to {_sendto::*}
		send "&6DisguiseMe &b> &3%size of {_missing::*}%&4 mandatory plugin(s) missing!" to {_sendto::*}
		send "&6DisguiseMe &b> &4Please add &3%{_missing::*}%" to {_sendto::*}
		send "&6DisguiseMe &b> " to {_sendto::*}
		send "&6DisguiseMe &b> " to {_sendto::*}
		send "&6DisguiseMe &b> &4---------------------------------" to {_sendto::*}
	if {DM::MCVersion} is 9 or 10 or 11:
		if {@JoinDelay} < 1 second:
			send "&6DisguiseMe &b> &4!!! The Join delay is less than 1 second, this could cause crashes to nearby players when a disguised player connects !!!" to {_sendto::*}

#Functions must be at the beginning with old versions of minecraft & Skript


#---------------------------------------------
#
#These functions convert a name into an Id (minecraft doesn't use "Sheep" for a sheep, it uses a number which changes almost every version)
#
#---------------------------------------------

#Function that converts a mob into an id for 1.15, 1.14 and 1.13
function MobToId(mob: text) :: int: #When an entity spawns, minecraft use a TypeOfMob which is a number and not its name (enderman -> 19 in 1.14 for instance) https://phe0x.fr/dev/ if you want to check quickly
	if {_mob} is "{@Bee}":
		if {DM::MCVersion} is 15:
			return 4
		else:
			return -5
	if {_mob} is "{@Hoglin}" or "{@Piglin}" or "{@Piglin_Brute}" or "{@Strider}" or "{@Zoglin}" or "{@Zombified_Piglin}": #Mob 1.16 uniquement, impossible avec la fonction utilisé en dessous
		return -5
	if {DM::MCVersion} is 13:
		if {_mob} is "{@Cat}" or "{@Fox}" or "{@Panda}" or "{@Trader_Llama}" or "{@Pillager}" or "{@Wandering_Trader}" or "{@Ravager}":
			return -5
	if {_mob} is "{@ArmorStand}":
		return 1
	if {_mob} is "{@Bat}":
		return 3
	if {_mob} is "{@Blaze}":
		return 4
	if {_mob} is "{@Cat}":
		return 6
	if {_mob} is "{@Cave_Spider}":
		return 7
	if {_mob} is "{@Chicken}":
		return 8
	if {_mob} is "{@Cod}":
		return 9
	if {_mob} is "{@Cow}":
		return 10
	if {_mob} is "{@Creeper}":
		return 11
	if {_mob} is "{@Donkey}":
		return 12
	if {_mob} is "{@Dolphin}":
		return 13
	if {_mob} is "{@Drowned}":
		return 15
	if {_mob} is "{@Elder_Guardian}":
		return 16
	if {_mob} is "{@Ender_Dragon}":
		return 18
	if {_mob} is "{@Enderman}":
		return 19
	if {_mob} is "{@Endermite}":
		return 20
	if {_mob} is "{@Evoker}":
		return 22
	if {_mob} is "{@Fox}":
		return 27
	if {_mob} is "{@Ghast}":
		return 28
	if {_mob} is "{@Giant}":
		return 29
	if {_mob} is "{@Guardian}":
		return 30
	if {_mob} is "{@Horse}":
		return 31
	if {_mob} is "{@Husk}":
		return 32
	if {_mob} is "{@Illusioner}":
		return 33
	if {_mob} is "{@Llama}":
		return 38
	if {_mob} is "{@Magma_Cube}":
		return 39
	if {_mob} is "{@Mule}":
		return 48
	if {_mob} is "{@Mooshroom}":
		return 49
	if {_mob} is "{@Ocelot}":
		return 50
	if {_mob} is "{@Panda}":
		return 52
	if {_mob} is "{@Parrot}":
		return 53
	if {_mob} is "{@Pig}":
		return 54
	if {_mob} is "{@PufferFish}":
		return 55
	if {_mob} is "{@Zombie_Pigman}":
		return 56
	if {_mob} is "{@Polar_Bear}":
		return 57
	if {_mob} is "{@Rabbit}":
		return 59
	if {_mob} is "{@Salmon}":
		return 60
	if {_mob} is "{@Sheep}":
		return 61
	if {_mob} is "{@Shulker}":
		return 62
	if {_mob} is "{@SilverFish}":
		return 64
	if {_mob} is "{@Skeleton}":
		return 65
	if {_mob} is "{@Skeleton_Horse}":
		return 66
	if {_mob} is "{@Slime}":
		return 67
	if {_mob} is "{@Snow_Golem}":
		return 69
	if {_mob} is "{@Spider}":
		return 72
	if {_mob} is "{@Squid}":
		return 73
	if {_mob} is "{@Stray}":
		return 74
	if {_mob} is "{@Trader_Llama}":
		return 75
	if {_mob} is "{@Tropical_Fish}":
		return 76
	if {_mob} is "{@Turtle}":
		return 77
	if {_mob} is "{@Vex}":
		return 83
	if {_mob} is "{@Villager}":
		return 84
	if {_mob} is "{@Iron_Golem}":
		return 85
	if {_mob} is "{@Vindicator}":
		return 86
	if {_mob} is "{@Pillager}":
		return 87
	if {_mob} is "{@Wandering_Trader}":
		return 88
	if {_mob} is "{@Witch}":
		return 89
	if {_mob} is "{@Wither}":
		return 90
	if {_mob} is "{@Wither_Skeleton}":
		return 91
	if {_mob} is "{@Wolf}":
		return 93
	if {_mob} is "{@Zombie}":
		return 94
	if {_mob} is "{@Zombie_Horse}":
		return 95
	if {_mob} is "{@Zombie_Villager}":
		return 96
	if {_mob} is "{@Phantom}":
		return 97
	if {_mob} is "{@Ravager}":
		return 98
	return -1
#Function that converts a mob into an id for 1.16
function MobToId16(mob: text) :: int: #Needs a new function, since there's almost no logical order (except Alphabetical, but hey, that's faster this way)
	if {_mob} is "{@Piglin_Brute}":
		if {DM::MCSubVersion} > 1: #Added in 1.16.2
			return -10 #With that I don't have to create a new function only for 1.16.2+ (This new mob shifted all id after 61 by 1 and took the id 61)
		return -1
	if {_mob} is "{@Zombie_Pigman}":
		return -6 #Removed
	if {_mob} is "{@ArmorStand}":
		return 1
	if {_mob} is "{@Bat}":
		return 3
	if {_mob} is "{@Bee}":
		return 4
	if {_mob} is "{@Blaze}":
		return 5
	if {_mob} is "{@Cat}":
		return 7
	if {_mob} is "{@Cave_Spider}":
		return 8
	if {_mob} is "{@Chicken}":
		return 9
	if {_mob} is "{@Cod}":
		return 10
	if {_mob} is "{@Cow}":
		return 11
	if {_mob} is "{@Creeper}":
		return 12
	if {_mob} is "{@Dolphin}":
		return 13
	if {_mob} is "{@Donkey}":
		return 14
	if {_mob} is "{@Drowned}":
		return 16
	if {_mob} is "{@Elder_Guardian}":
		return 17
	if {_mob} is "{@Ender_Dragon}":
		return 19
	if {_mob} is "{@Enderman}":
		return 20
	if {_mob} is "{@Endermite}":
		return 21
	if {_mob} is "{@Evoker}":
		return 22
	if {_mob} is "{@Fox}":
		return 28
	if {_mob} is "{@Ghast}":
		return 29
	if {_mob} is "{@Giant}":
		return 30
	if {_mob} is "{@Guardian}":
		return 31
	if {_mob} is "{@Hoglin}":
		return 32
	if {_mob} is "{@Horse}":
		return 33
	if {_mob} is "{@Husk}":
		return 34
	if {_mob} is "{@Illusioner}":
		return 35
	if {_mob} is "{@Iron_Golem}":
		return 36
	if {_mob} is "{@Llama}":
		return 42
	if {_mob} is "{@Magma_Cube}":
		return 44
	if {_mob} is "{@Mule}":
		return 52
	if {_mob} is "{@Mooshroom}":
		return 53
	if {_mob} is "{@Ocelot}":
		return 54
	if {_mob} is "{@Panda}":
		return 56
	if {_mob} is "{@Parrot}":
		return 57
	if {_mob} is "{@Pig}":
		return 59
	if {_mob} is "{@Piglin}":
		return 60
	if {_mob} is "{@Pillager}":
		return 61
	if {_mob} is "{@Polar_Bear}":
		return 62
	if {_mob} is "{@PufferFish}":
		return 64
	if {_mob} is "{@Rabbit}":
		return 65
	if {_mob} is "{@Ravager}":
		return 66
	if {_mob} is "{@Salmon}":
		return 67
	if {_mob} is "{@Sheep}":
		return 68
	if {_mob} is "{@Shulker}":
		return 69
	if {_mob} is "{@SilverFish}":
		return 71
	if {_mob} is "{@Skeleton}":
		return 72
	if {_mob} is "{@Skeleton_Horse}":
		return 73
	if {_mob} is "{@Slime}":
		return 74
	if {_mob} is "{@Snow_Golem}":
		return 76
	if {_mob} is "{@Spider}":
		return 79
	if {_mob} is "{@Squid}":
		return 80
	if {_mob} is "{@Stray}":
		return 81
	if {_mob} is "{@Strider}":
		return 82
	if {_mob} is "{@Trader_Llama}":
		return 88
	if {_mob} is "{@Tropical_Fish}":
		return 89
	if {_mob} is "{@Turtle}":
		return 90
	if {_mob} is "{@Vex}":
		return 91
	if {_mob} is "{@Villager}":
		return 92
	if {_mob} is "{@Vindicator}":
		return 93
	if {_mob} is "{@Wandering_Trader}":
		return 94
	if {_mob} is "{@Witch}":
		return 95
	if {_mob} is "{@Wither}":
		return 96
	if {_mob} is "{@Wither_Skeleton}":
		return 97
	if {_mob} is "{@Wolf}":
		return 99
	if {_mob} is "{@Zoglin}":
		return 100
	if {_mob} is "{@Zombie}":
		return 101
	if {_mob} is "{@Zombie_Horse}":
		return 102
	if {_mob} is "{@Zombie_Villager}":
		return 103
	if {_mob} is "{@Zombified_Piglin}":
		return 104
	return -1
#Function that converts a mob into an id for 1.12, 1.11, 1.10, 1.9 and 1.8
function MobToId12(mob: text) :: int:
	if {_mob} is "{@Bee}" or "{@Cod}" or "{@Dolphin}" or "{@Drowned}" or "{@Fox}" or "{@Panda}" or "{@PufferFish}" or "{@Salmon}" or "{@Trader_Llama}" or "{@Tropical_Fish}" or "{@Turtle}" or "{@Pillager}" or "{@Wandering_Trader}" or "{@Phantom}" or "{@Ravager}" or "{@Hoglin}" or "{@Piglin}" or "{@Piglin_Brute}" or "{@Strider}" or "{@Zoglin}" or "{@Zombified_Piglin}":
		return -5
	if {DM::MCVersion} <= 11:
		if {_mob} is "{@Illusioner}" or "{@Parrot}":
			return -5
	if {DM::MCVersion} <= 10:
		if {_mob} is "{@Elder_Guardian}" or "{@Wither_Skeleton}" or "{@Stray}" or "{@Husk}" or "{@Zombie_Villager}" or "{@Skeleton_Horse}" or "{@Zombie_Horse}" or "{@Donkey}" or "{@Mule}" or "{@Evoker}" or "{@Vex}" or "{@Vindicator}" or "{@Llama}":
			return -5
	if {DM::MCVersion} <= 9:
		if {_mob} is "{@Polar_Bear}":
			return -5
	if {DM::MCVersion} <= 8:
		if {_mob} is "{@Shulker}":
			return -5
	if {_mob} is "{@Elder_Guardian}":
		return 4
	if {_mob} is "{@Wither_Skeleton}":
		return 5
	if {_mob} is "{@Stray}":
		return 6
	if {_mob} is "{@Husk}":
		return 23
	if {_mob} is "{@Zombie_Villager}":
		return 27
	if {_mob} is "{@Skeleton_Horse}":
		return 28
	if {_mob} is "{@Zombie_Horse}":
		return 29
	if {_mob} is "{@ArmorStand}":
		return 30
	if {_mob} is "{@Donkey}": 
		return 31
	if {_mob} is "{@Mule}":
		return 32
	if {_mob} is "{@Evoker}":
		return 34
	if {_mob} is "{@Vex}":
		return 35
	if {_mob} is "{@Vindicator}":
		return 36
	if {_mob} is "{@Illusioner}":
		return 37
	if {_mob} is "{@Creeper}":
		return 50
	if {_mob} is "{@Skeleton}":
		return 51
	if {_mob} is "{@Spider}":
		return 52
	if {_mob} is "{@Giant}":
		return 53
	if {_mob} is "{@Zombie}":
		return 54
	if {_mob} is "{@Slime}":
		return 55
	if {_mob} is "{@Ghast}":
		return 56
	if {_mob} is "{@Zombie_Pigman}":
		return 57
	if {_mob} is "{@Enderman}":
		return 58
	if {_mob} is "{@Cave_Spider}":
		return 59
	if {_mob} is "{@SilverFish}":
		return 60
	if {_mob} is "{@Blaze}":
		return 61
	if {_mob} is "{@Magma_Cube}":
		return 62
	if {_mob} is "{@Ender_Dragon}":
		return 63
	if {_mob} is "{@Wither}":
		return 64
	if {_mob} is "{@Bat}":
		return 65
	if {_mob} is "{@Witch}":
		return 66
	if {_mob} is "{@Endermite}":
		return 67
	if {_mob} is "{@Guardian}":
		return 68
	if {_mob} is "{@Shulker}":
		return 69
	if {_mob} is "{@Pig}":
		return 90
	if {_mob} is "{@Sheep}":
		return 91
	if {_mob} is "{@Cow}":
		return 92
	if {_mob} is "{@Chicken}":
		return 93
	if {_mob} is "{@Squid}":
		return 94
	if {_mob} is "{@Wolf}":
		return 95
	if {_mob} is "{@Mooshroom}":
		return 96
	if {_mob} is "{@Snow_Golem}":
		return 97
	if {_mob} is "{@Ocelot}":
		return 98
	if {_mob} is "{@Iron_Golem}":
		return 99
	if {_mob} is "{@Horse}":
		return 100
	if {_mob} is "{@Rabbit}":
		return 101
	if {_mob} is "{@Polar_Bear}":
		return 102
	if {_mob} is "{@Llama}":
		return 103
	if {_mob} is "{@Parrot}":
		return 105
	if {_mob} is "{@Villager}":
		return 120
	return -1
function SkinReload(p: player): #Mandatory only for 1.15 and 1.16
	{DM::MCVersion} >= 15 #Sending already known infos doesn't work, so I send 2 almost indentical packets
	set {_packetsettings} to new play_client_settings packet
	set string field 0 of {_packetsettings} to {DM::HiddenPSettings::%{_p}%::Lang}
	set int field 0 of {_packetsettings} to {DM::HiddenPSettings::%{_p}%::View}
	set chatvisibility field 0 of {_packetsettings} to {DM::HiddenPSettings::%{_p}%::ChatVisibility}
	set boolean field 0 of {_packetsettings} to {DM::HiddenPSettings::%{_p}%::ChatColor}
	set int field 1 of {_packetsettings} to {DM::HiddenPSettings::%{_p}%::Skin}-1 #Remove the player's cape and force the reactualisation
	set object field 5 of {_packetsettings} to {DM::HiddenPSettings::%{_p}%::Hand}
	receive packet {_packetsettings} from {_p}
	wait 1 tick
	set {_packetsettings2} to new play_client_settings packet
	set string field 0 of {_packetsettings2} to {DM::HiddenPSettings::%{_p}%::Lang}
	set int field 0 of {_packetsettings2} to {DM::HiddenPSettings::%{_p}%::View}
	set chatvisibility field 0 of {_packetsettings2} to {DM::HiddenPSettings::%{_p}%::ChatVisibility}
	set boolean field 0 of {_packetsettings2} to {DM::HiddenPSettings::%{_p}%::ChatColor}
	set int field 1 of {_packetsettings2} to {DM::HiddenPSettings::%{_p}%::Skin}+1 #Add the cape back
	set object field 5 of {_packetsettings2} to {DM::HiddenPSettings::%{_p}%::Hand}
	receive packet {_packetsettings2} from {_p}

#Function to show the stuff of a player on his disguise when possible (like on a Zombie, Giant, Skeleton...)
#Thanks to Anarchick for the help on this
function UpdateStuff16(p: player, tosee: players): #Quite long but threw errors when compacted (cus i probably messed up, but this work fine!)
	set {_packetupdatestuff} to new play_server_entity_equipment packet
	set int pnum 0 of {_packetupdatestuff} to {_p}.getEntityId()
	set {_ArrayList} to new ArrayList()
	set {_HeadSlot} to ItemSlot.valueOf("HEAD") #Helmet
	set {_helmet} to {_p}'s helmet
	set {_PairHead} to new Pair({_HeadSlot} and {_helmet}) 
	{_ArrayList}.add({_PairHead})
	set {_ChestSlot} to ItemSlot.valueOf("CHEST") #Chestplate
	set {_chestplate} to {_p}'s chestplate
	set {_PairChest} to new Pair({_ChestSlot} and {_chestplate})
	{_ArrayList}.add({_PairChest})
	set {_LegsSlot} to ItemSlot.valueOf("LEGS") #Leggings
	set {_leggings} to {_p}'s leggings
	set {_PairLegs} to new Pair({_LegsSlot} and {_leggings})
	{_ArrayList}.add({_PairLegs})
	set {_FeetSlot} to ItemSlot.valueOf("FEET") #Boots
	set {_boots} to {_p}'s boots
	set {_PairFeet} to new Pair({_FeetSlot} and {_boots})
	{_ArrayList}.add({_PairFeet})
	set {_HandSlot} to ItemSlot.valueOf("MAINHAND") #Main hand
	set {_hand} to {_p}'s tool
	set {_PairHand} to new Pair({_HandSlot} and {_hand})
	{_ArrayList}.add({_PairHand})
	set {_OffSlot} to ItemSlot.valueOf("OFFHAND") #Off hand
	set {_off} to {_p}'s off hand tool
	set {_PairOff} to new Pair({_OffSlot} and {_off})
	{_ArrayList}.add({_PairOff})
	{_packetupdatestuff}.getSlotStackPairLists().write(0 and {_ArrayList})
	send packet {_packetupdatestuff} to {_tosee::*}

#The same function for 1.8 and 1.9-1.15 (Thanks Anarchick for the tiny help on this one too)
function UpdateStuff(p: player, tosee: players): 
	remove {_p} from {_tosee::*}
	set {_id} to {_p}.getEntityId()
	set {_packetHand} to new play_server_entity_equipment packet
	set {_packetHelmet} to new play_server_entity_equipment packet
	set {_packetChestplate} to new play_server_entity_equipment packet
	set {_packetLeggings} to new play_server_entity_equipment packet
	set {_packetBoots} to new play_server_entity_equipment packet
	set int pnum 0 of {_packetHand} to {_id}
	set int pnum 0 of {_packetHelmet} to {_id}
	set int pnum 0 of {_packetChestplate} to {_id}
	set int pnum 0 of {_packetLeggings} to {_id}
	set int pnum 0 of {_packetBoots} to {_id}
	set itemstack field 0 of {_packetHand} to {_p}'s tool
	set itemstack field 0 of {_packetHelmet} to {_p}'s helmet
	set itemstack field 0 of {_packetChestplate} to {_p}'s chestplate
	set itemstack field 0 of {_packetLeggings} to {_p}'s leggings
	set itemstack field 0 of {_packetBoots} to {_p}'s boots
	if {DM::MCVersion} > 8: #The packet was changed in 1.9 (and was later changed in 1.16). It's the same from 1.9 to 1.15 (both included)
		set {_packetOffHand} to new play_server_entity_equipment packet #No need to check if the mc version is greater than 15 since this function is called only when the version is less or equal to 15
		set ItemSlot field 0 of {_packetHand} to "mainhand"
		set ItemSlot field 0 of {_packetHelmet} to "head" 
		set ItemSlot field 0 of {_packetChestplate} to "chest" 
		set ItemSlot field 0 of {_packetLeggings} to "legs" 
		set ItemSlot field 0 of {_packetBoots} to "feet"
		set ItemSlot field 0 of {_packetOffHand} to "offhand"
		set int pnum 0 of {_packetOffHand} to {_id}
		set itemstack field 0 of {_packetOffHand} to {_p}'s off hand tool
		send packet {_packetOffHand} to {_tosee::*}
	if {DM::MCVersion} <= 8:
		wait 2 ticks #Mandatory for old Skript versions
		set int field 1 of {_packetHand} to 0
		set int field 1 of {_packetHelmet} to 4
		set int field 1 of {_packetChestplate} to 3
		set int field 1 of {_packetLeggings} to 2
		set int field 1 of {_packetBoots} to 1
	send packet {_packetHand} to {_tosee::*}
	send packet {_packetHelmet} to {_tosee::*}
	send packet {_packetChestplate} to {_tosee::*}
	send packet {_packetLeggings} to {_tosee::*}
	send packet {_packetBoots} to {_tosee::*} 

command /disguise [<text>] [<player>]:
	permission: self.disguise
	permission message: &cYou don't have the permission to execute this command
	usage: &4Syntax &b» &3/disguise help to show the help
	trigger:
		if arg 1 is not set:
			send "&6DisguiseMe &b» &cInvalid syntax !"
			send "&3Help &7» &b/disguise help"
			stop
		if arg 1 is "help":
			send "&6DisguiseMe &b» &2Version 1.1"
			send "&6DisguiseMe &b» &aCommands"
			send "&3List of mobs &7» &b/disguise list"
			send "&3Disguise yourself &7» &b/disguise <Mob>"
			if player has permission "other.disguise":
				send "&3Disguise a player &7» &b/disguise <Mob> <player>"
			if player has permission "self.undisguise":
				send "&3Remove your disguise &7» &b/undisguise"
				if player has permission "other.undisguise":
					send "&3Remove a player's disguise &7» &b/undisguise <player>"
			stop
		if arg 1 is "list":
			send "&6DisguiseMe &b» &3Mob list:"
			if {DM::MCVersion} is 8:
				send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Chicken}, {@Cow}, {@Horse}, {@Mooshroom}, {@Ocelot}, {@Pig}, {@Rabbit}, {@Sheep}, {@Snow_Golem}, {@Squid}, {@Villager}, {@Iron_Golem}, {@Wolf}"
				send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Ghast}, {@Giant}, {@Guardian}, {@Magma_Cube}, {@Zombie_Pigman}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Witch}, {@Wither}, {@Zombie}"
			else if {DM::MCVersion} is 9:
				send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Chicken}, {@Cow}, {@Horse}, {@Mooshroom}, {@Ocelot}, {@Pig}, {@Rabbit}, {@Sheep}, {@Snow_Golem}, {@Squid}, {@Villager}, {@Iron_Golem}, {@Wolf}"
				send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Ghast}, {@Giant}, {@Guardian}, {@Magma_Cube}, {@Zombie_Pigman}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Witch}, {@Wither}, {@Zombie}"
			else if {DM::MCVersion} is 10:
				send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Chicken}, {@Cow}, {@Horse}, {@Mooshroom}, {@Ocelot}, {@Pig}, {@Polar_Bear}, {@Rabbit}, {@Sheep}, {@Snow_Golem}, {@Squid}, {@Villager}, {@Iron_Golem}, {@Wolf}"
				send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Ghast}, {@Giant}, {@Guardian}, {@Magma_Cube}, {@Zombie_Pigman}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Witch}, {@Wither}, {@Zombie}"
			else if {DM::MCVersion} is 11:
				send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Chicken}, {@Cow}, {@Donkey}, {@Horse}, {@Mule}, {@Mooshroom}, {@Ocelot}, {@Pig}, {@Polar_Bear}, {@Rabbit}, {@Sheep}, {@Skeleton_Horse}, {@Snow_Golem}, {@Squid}, {@Villager}, {@Iron_Golem}, {@Wolf}, {@Zombie_Horse}"
				send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Elder_Guardian}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Evoker}, {@Ghast}, {@Giant}, {@Guardian}, {@Husk}, {@Magma_Cube}, {@Zombie_Pigman}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Stray}, {@Vex}, {@Vindicator}, {@Witch}, {@Wither}, {@Wither_Skeleton}, {@Zombie}, {@Zombie_Villager}"
			else if {DM::MCVersion} is 12:
				send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Chicken}, {@Cow}, {@Donkey}, {@Horse}, {@Mule}, {@Mooshroom}, {@Ocelot}, {@Parrot}, {@Pig}, {@Polar_Bear}, {@Rabbit}, {@Sheep}, {@Skeleton_Horse}, {@Snow_Golem}, {@Squid}, {@Villager}, {@Iron_Golem}, {@Wolf}, {@Zombie_Horse}"
				send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Elder_Guardian}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Evoker}, {@Ghast}, {@Giant}, {@Guardian}, {@Husk}, {@Illusioner}, {@Magma_Cube}, {@Zombie_Pigman}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Stray}, {@Vex}, {@Vindicator}, {@Witch}, {@Wither}, {@Wither_Skeleton}, {@Zombie}, {@Zombie_Villager}"
			else if {DM::MCVersion} is 13:
				send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Chicken}, {@Cod}, {@Cow}, {@Donkey}, {@Dolphin}, {@Horse}, {@Llama}, {@Mule}, {@Mooshroom}, {@Ocelot}, {@Parrot}, {@Pig}, {@PufferFish}, {@Polar_Bear}, {@Rabbit}, {@Salmon}, {@Sheep}, {@Skeleton_Horse}, {@Snow_Golem}, {@Squid}, {@Tropical_Fish}, {@Turtle}, {@Villager}, {@Iron_Golem}, {@Wolf}, {@Zombie_Horse}"
				send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Drowned}, {@Elder_Guardian}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Evoker}, {@Ghast}, {@Giant}, {@Guardian}, {@Husk}, {@Illusioner}, {@Magma_Cube}, {@Zombie_Pigman}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Stray}, {@Vex}, {@Vindicator}, {@Witch}, {@Wither}, {@Wither_Skeleton}, {@Zombie}, {@Zombie_Villager}, {@Phantom}"
			else if {DM::MCVersion} is 14:
				send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Cat}, {@Chicken}, {@Cod}, {@Cow}, {@Donkey}, {@Dolphin}, {@Fox}, {@Horse}, {@Llama}, {@Mule}, {@Mooshroom}, {@Ocelot}, {@Panda}, {@Parrot}, {@Pig}, {@PufferFish}, {@Polar_Bear}, {@Rabbit}, {@Salmon}, {@Sheep}, {@Skeleton_Horse}, {@Snow_Golem}, {@Squid}, {@Trader_Llama}, {@Tropical_Fish}, {@Turtle}, {@Villager}, {@Iron_Golem}, {@Wandering_Trader}, {@Wolf}, {@Zombie_Horse}"
				send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Drowned}, {@Elder_Guardian}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Evoker}, {@Ghast}, {@Giant}, {@Guardian}, {@Husk}, {@Illusioner}, {@Magma_Cube}, {@Zombie_Pigman}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Stray}, {@Vex}, {@Vindicator}, {@Pillager}, {@Witch}, {@Wither}, {@Wither_Skeleton}, {@Zombie}, {@Zombie_Villager}, {@Phantom}, {@Ravager}"
			else if {DM::MCVersion} is 15:
				send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Bee}, {@Cat}, {@Chicken}, {@Cod}, {@Cow}, {@Donkey}, {@Dolphin}, {@Fox}, {@Horse}, {@Llama}, {@Mule}, {@Mooshroom}, {@Ocelot}, {@Panda}, {@Parrot}, {@Pig}, {@PufferFish}, {@Polar_Bear}, {@Rabbit}, {@Salmon}, {@Sheep}, {@Skeleton_Horse}, {@Snow_Golem}, {@Squid}, {@Trader_Llama}, {@Tropical_Fish}, {@Turtle}, {@Villager}, {@Iron_Golem}, {@Wandering_Trader}, {@Wolf}, {@Zombie_Horse}"
				send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Drowned}, {@Elder_Guardian}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Evoker}, {@Ghast}, {@Giant}, {@Guardian}, {@Husk}, {@Illusioner}, {@Magma_Cube}, {@Zombie_Pigman}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Stray}, {@Vex}, {@Vindicator}, {@Pillager}, {@Witch}, {@Wither}, {@Wither_Skeleton}, {@Zombie}, {@Zombie_Villager}, {@Phantom}, {@Ravager}"
			else if {DM::MCVersion} is 16:
				if {DM::MCSubVersion} < 2: #The piglin brute was added in 1.16.2
					send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Bee}, {@Cat}, {@Chicken}, {@Cod}, {@Cow}, {@Donkey}, {@Dolphin}, {@Fox}, {@Horse}, {@Llama}, {@Mule}, {@Mooshroom}, {@Ocelot}, {@Panda}, {@Parrot}, {@Pig}, {@PufferFish}, {@Polar_Bear}, {@Rabbit}, {@Salmon}, {@Sheep}, {@Skeleton_Horse}, {@Snow_Golem}, {@Squid}, {@Strider}, {@Trader_Llama}, {@Tropical_Fish}, {@Turtle}, {@Villager}, {@Iron_Golem}, {@Wandering_Trader}, {@Wolf}, {@Zombie_Horse}"
					send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Drowned}, {@Elder_Guardian}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Evoker}, {@Ghast}, {@Giant}, {@Guardian}, , {@Hoglin}, {@Husk}, {@Illusioner}, {@Magma_Cube}, {@Phantom}, {@Ravager}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Stray}, {@Vex}, {@Vindicator}, {@Piglin}, {@Pillager}, {@Witch}, {@Wither}, {@Wither_Skeleton}, {@Zombie}, {@Zombie_Villager}, {@Zoglin}, {@Zombified_Piglin}"
				else:
					send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Bee}, {@Cat}, {@Chicken}, {@Cod}, {@Cow}, {@Donkey}, {@Dolphin}, {@Fox}, {@Horse}, {@Llama}, {@Mule}, {@Mooshroom}, {@Ocelot}, {@Panda}, {@Parrot}, {@Pig}, {@PufferFish}, {@Polar_Bear}, {@Rabbit}, {@Salmon}, {@Sheep}, {@Skeleton_Horse}, {@Snow_Golem}, {@Squid}, {@Strider}, {@Trader_Llama}, {@Tropical_Fish}, {@Turtle}, {@Villager}, {@Iron_Golem}, {@Wandering_Trader}, {@Wolf}, {@Zombie_Horse}"
					send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Drowned}, {@Elder_Guardian}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Evoker}, {@Ghast}, {@Giant}, {@Guardian}, , {@Hoglin}, {@Husk}, {@Illusioner}, {@Magma_Cube}, {@Phantom}, {@Ravager}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Stray}, {@Vex}, {@Vindicator}, {@Piglin}, {@Piglin_Brute}, {@Pillager}, {@Witch}, {@Wither}, {@Wither_Skeleton}, {@Zombie}, {@Zombie_Villager}, {@Zoglin}, {@Zombified_Piglin}"

			else:
				send "&6DisguiseMe &b» &cYour version is not supported, so here is the 1.16 list" 
				send "&dPeaceful &f» &7{@ArmorStand}, {@Bat}, {@Bee}, {@Cat}, {@Chicken}, {@Cod}, {@Cow}, {@Donkey}, {@Dolphin}, {@Fox}, {@Horse}, {@Llama}, {@Mule}, {@Mooshroom}, {@Ocelot}, {@Panda}, {@Parrot}, {@Pig}, {@PufferFish}, {@Polar_Bear}, {@Rabbit}, {@Salmon}, {@Sheep}, {@Skeleton_Horse}, {@Snow_Golem}, {@Squid}, {@Strider}, {@Trader_Llama}, {@Tropical_Fish}, {@Turtle}, {@Villager}, {@Iron_Golem}, {@Wandering_Trader}, {@Wolf}, {@Zombie_Horse}"
				send "&dAggressive &f» &7{@Blaze}, {@Cave_Spider}, {@Creeper}, {@Drowned}, {@Elder_Guardian}, {@Ender_Dragon}, {@Enderman}, {@Endermite}, {@Evoker}, {@Ghast}, {@Giant}, {@Guardian}, , {@Hoglin}, {@Husk}, {@Illusioner}, {@Magma_Cube}, {@Phantom}, {@Ravager}, {@Shulker}, {@SilverFish}, {@Skeleton}, {@Slime}, {@Spider}, {@Stray}, {@Vex}, {@Vindicator}, {@Piglin}, {@Piglin_Brute}, {@Pillager}, {@Witch}, {@Wither}, {@Wither_Skeleton}, {@Zombie}, {@Zombie_Villager}, {@Zoglin}, {@Zombified_Piglin}"
			stop
		set {_id} to MobToId(arg-1)
		if {DM::MCVersion} <= 12:
			set {_id} to MobToId12(arg-1)
		if {DM::MCVersion} >= 16: #1.17 =)
			set {_id} to MobToId16(arg-1)
			if {DM::MCSubVersion} > 1:
				if {_id} >= 61:
					add 1 to {_id}
				if {_id} = -10:
					set {_id} to 61 #Piglin brute (easier to shift everything by 1, see above)
			if {DM::MCVersion} >= 17: #We never knows lmao
				if {_id} >= 61: 
					add 1 to {_id}
				if {_id} = -10:
					set {_id} to 61 
		if {_id} is -1:
			send "&6DisguiseMe &b» &cThis mob doesn't exist !"
			send "&3Mob list &7» &b/disguise list"
			stop
		if {_id} is -5:
			send "&6DisguiseMe &b» &cThis mob is not supported or doesn't exist in your version ! &d(1.%{DM::MCVersion}%&d)"
			send "&3Mob list &7» &b/disguise list"
			stop
		if {_id} is -6:
			send "&6DisguiseMe &b» &cThis mob is not supported or doesn't exist in your version ! &d(1.%{DM::MCVersion}%&d)"
			send "&6DisguiseMe &b» &eThis mob was deleted in 1.16. {@Zombie_Pigman} were replaced by {@Piglin} !"
			send "&3Mob list &7» &b/disguise list"
			stop
		if {DM::MCVersion} is 15:
			if arg-1 is not "{@ArmorStand}" or "{@Bat}" or "{@Bee}":
				add 1 to {_id}
		if {DM::MCVersion} is 13:#1.13 has a weird logic but stilm follows the same pattern as 1.14/1.15 for type of mobs
			if arg-1 is "{@ArmorStand}" or "{@Bat}" or "{@Blaze}":
				set {_id} to {_id}
			else if arg-1 is "{@Cave_Spider}" or "{@Chicken}" or "{@Cod}" or "{@Cow}" or "{@Cow}" or "{@Creeper}" or "{@Donkey}" or "{@Dolphin}" or "{@Drowned}" or "{@Elder_Guardian}" or "{@Ender_Dragon}" or "{@Enderman}" or "{@Endermite}" or "{@Evoker}" or "{@Magma_Cube}":
				remove 1 from {_id}
			else if arg-1 is "{@Ghast}" or "{@Giant}" or "{@Guardian}" or "{@Horse}" or "{@Husk}" or "{@Illusioner}" or "{@Llama}" or "{@Mule}" or "{@Mooshroom}" or "{@Ocelot}":
				remove 2 from {_id}
			else if arg-1 is "{@Parrot}" or "{@Pig}" or "{@PufferFish}" or "{@Zombie_Pigman}" or "{@Polar_Bear}" or "{@Rabbit}" or "{@Salmon}" or "{@Sheep}" or "{@Shulker}" or "{@SilverFish}" or "{@Skeleton}" or "{@Skeleton_Horse}" or "{@Slime}" or "{@Snow_Golem}" or "{@Spider}" or "{@Squid}" or "{@Stray}":
				remove 3 from {_id}
			else if arg-1 is "{@Tropical_Fish}" or "{@Turtle}":
				remove 4 from {_id}
			else if arg-1 is "{@Vex}" or "{@Villager}" or "{@Iron_Golem}" or "{@Vindicator}":
				remove 5 from {_id}
			else:
				remove 7 from {_id}
		if arg 2 is not set:
			set {_exception} to player
		else:
			if player has permission "other.disguise":
				set {_exception} to arg-2
			else:
				send "&6DisguiseMe &b» &cYou don't have the permission to disguise another player"
				send "&4Syntax &b» &3/disguise <Mob>"
				stop
		if {DM::MCVersion} is not between 8 and 16: #1.7 or below, 1.17 or above
			send "&6DisguiseMe &b» &4⚠This skript was made for all versions between 1.8 and 1.16, you may experience bugs !⚠" 
		if arg-1 is "{@Villager}":
			if {DM::MCVersion} is 9 or 10:
				send "&6DisguiseMe &c» &4⚠&dIn this version, a player right clicking on a {@Villager} disguise will crash ! &e(Trying to open an inventory that doesn't exist)"
			if {DM::MCVersion} is 8:
				send "&6DisguiseMe &c» &4⚠&dIn this version, a player right clicking on a {@Villager} disguise will make the disguised player invisible for him !"
		if arg-1 is "{@Shulker}":
			send "&6DisguiseMe &c» &4⚠&dBecause of the way minecraft works, &4players won't see the disguise move &d(shulkers can't move in vanilla)"
		if arg-1 is "{@Ender_Dragon}":
			send "&6DisguiseMe &c» &4⚠&dBecause of the way minecraft works, &4players will see the disguise looking in the wrong direction &d(I have a fix but it creates too much lag)"
		set {_packet} to new play_server_spawn_entity_living packet
		set {_eId} to {_exception}.getEntityId()
		set {_uuid} to {_exception}'s uuid
		set {_xloc} to x location of {_exception}
		set {_yloc} to y location of {_exception}
		set {_zloc} to z location of {_exception}
		set {_pitch} to ({_exception}'s location).getPitch()
		set {_yaw} to ({_exception}'s location).getYaw()
		set {_fYaw} to {_yaw}*256/360 #Yaws & pitchs are not the one shown on the F3 menu or by Skript/Spigot, they are "compressed"
		set {_fPitch} to {_pitch}*256/360
		if {DM::MCVersion} >= 9: #The packet changed in 1.9
			set int pnum 0 of {_packet} to {_eId} #EID
			set uuid field 0 of {_packet} to "%{_uuid}%" #E UUID
			set int pnum 1 of {_packet} to {_id} #Type of mob
			set double pnum 0 of {_packet} to {_xloc} #X location
			set double pnum 1 of {_packet} to {_yloc} #y location
			set double pnum 2 of {_packet} to {_zloc} #Z location
			set int pnum 2 of {_packet} to 0 #X velocity
			set int pnum 3 of {_packet} to 0 #Y Velocity
			set int pnum 4 of {_packet} to 0 #Z Velocity
			set byte pnum 0 of {_packet} to {_fYaw} #arg-1's yaw
			set byte pnum 1 of {_packet} to {_fPitch} #pitch
			set byte pnum 2 of {_packet} to {_fYaw} #yaw again (for the body I think)
		if {DM::MCVersion} <= 8: 
			set int pnum 0 of {_packet} to {_eId} 
			set int pnum 1 of {_packet} to {_id} 
			set int pnum 2 of {_packet} to {_xloc}*32 #Must be multiplied by 32 in 1.8, since it's an int
			set int pnum 3 of {_packet} to {_yloc}*32 
			set int pnum 4 of {_packet} to {_zloc}*32 
			set int pnum 5 of {_packet} to 0 
			set int pnum 6 of {_packet} to 0 
			set int pnum 7 of {_packet} to 0 
			set byte pnum 0 of {_packet} to {_fYaw} 
			set byte pnum 1 of {_packet} to {_fPitch} 
			set byte pnum 2 of {_packet} to {_fYaw} 	
		if {@Name} is true:
			if {DM::MCVersion} = 9 or 10 or 11 or 12:
				set watched string 2 of data watcher field 0 of {_packet} to "%{_exception}%" #Mojang removed this field in 1.14, idk why (that's dumb btw)
			else if {DM::MCVersion} is 13:
				set {_name} to Optional.of(new ChatComponentText("%{_exception}%"))
				set {_WDW} to new WrappedDataWatcher() #Must be done with sk mirror because ThatPacketAddon doesn't accept optional chat (Thanks Rush²Fer)
				set {_Serializer} to DWReg.getChatComponentSerializer(true) 
				set {_Dw} to new DWObject(2 and {_Serializer})
				{_WDW}.setObject({_Dw} and {_name})		
				set data watcher field 0 of {_packet} to {_WDW}
			else if {DM::MCVersion} <= 8:
				set {_name} to "%{_exception}%"
				set {_WDW} to new WrappedDataWatcher() #Watched strings don't work in 1.8 (idk why), so I use protocollib 
				{_WDW}.setObject(2 and {_name})		
				set data watcher field 0 of {_packet} to {_WDW}
			else: #1.14 and above need a different packet to show the name above the disguise
				set {_packetMeta} to new play_server_entity_metadata packet
				set int pnum 0 of {_packetMeta} to {_exception}.getEntityId() #EID
				set {_name} to Optional.of(new ChatComponentText("%{_exception}%"))
				set {_WDW} to new WrappedDataWatcher() #Same as above
				set {_Serializer} to DWReg.getChatComponentSerializer(true)
				set {_Dw} to new DWObject(2 and {_Serializer})
				{_WDW}.setObject({_Dw} and {_name})		
				set watchable collection field 0 of {_packetMeta} to {_WDW}
		set {_playerlist::*} to all players in radius 50 around {_exception}
		remove {_exception} from {_playerlist::*}
		#Show the disguise to all nearby players, without looping (probably faster to do it this way, since otherwise I'd have to loop again)
		send packet {_packet} to {_playerlist::*}
		send packet {_packetMeta} to {_playerlist::*}
		set {DM::HIDDENPlayer::%{_uuid}%} to true
		set {DM::HIDDENUUID::%{_eId}%} to {_uuid}
		set {DM::HIDDENId::%{_eId}%} to {_exception}
		set {DM::HIDDENDisguise::%{_eId}%} to {_id}
		set {DM::HIDDENForAll::%{_eId}%} to true
		if arg-2 is set:
			send "&6DisguiseMe &b» &3%{_exception}% is now disguised as &d%arg 1% &afor everyone !" 
		if arg-2 is not set:
			send "&6DisguiseMe &b» &3You are now disguised as &d%arg 1% &afor everyone !" 
		if {@UpdateStuff} is true:
			if {DM::MCVersion} >= 16:
				UpdateStuff16({_exception}, {_playerlist::*})
			if {DM::MCVersion} <= 15:
				UpdateStuff({_exception}, {_playerlist::*})
on quit:
	if {DM::HIDDENPlayer::%uuid of player%} is true:
		set {DM::LeftHiddenDisguise::%uuid of player%} to {DM::HIDDENDisguise::%player.getEntityId()%}
		if {DM::HIDDENForAll::%player.getEntityId()%} is true:
			set {DM::LeftHiddenForAll::%uuid of player%} to true
		if {DM::HIDDENForAll::%player.getEntityId()%} is false:
			set {DM::LeftHiddenForAll::%uuid of player%} to false
			set {DM::LeftHiddenList::%uuid of player%::*} to {DM::HiddenList::%player.getEntityId()%::*}
	clear {DM::HIDDENPlayer::%uuid of player%}
	clear {DM::HIDDENUUID::%player.getEntityId()%}
	clear {DM::HIDDENId::%player.getEntityId()%}
	clear {DM::HIDDENDisguise::%player.getEntityId()%}
	clear {DM::HIDDENForAll::%player.getEntityId()%}
	clear {DM::HiddenList::%player.getEntityId()%::*}
	clear {DM::HiddenPSettings::%player%::*}
on join:
	set {DM::IdToPlayer::%player.getEntityId()%} to player
	set {DM::LastJoin::%player%} to now
	if {DM::LeftHiddenDisguise::%uuid of player%} is set:
		set {DM::HIDDENPlayer::%uuid of player%} to true
		set {DM::HIDDENUUID::%player.getEntityId()%} to UUID of player
		set {DM::HIDDENId::%player.getEntityId()%} to player
		set {DM::HIDDENDisguise::%player.getEntityId()%} to {DM::LeftHiddenDisguise::%uuid of player%}
		if {DM::LeftHiddenForAll::%uuid of player%} is true:
			set {DM::HIDDENForAll::%player.getEntityId()%} to true
		if {DM::HIDDENForAll::%player.getEntityId()%} is false:
			set {DM::HiddenList::%player.getEntityId()%::*} to {DM::LeftHiddenList::%uuid of player%::*}
		{DM::MCVersion} is 9 or 10 or 11
		wait {@JoinDelay} #Mandatory, otherwise players in 1.9, 1.10 or 1.11 crash
		set {_exception} to player
		set {_eId} to {_exception}.getEntityId()
		set {_uuid} to {_exception}'s uuid
		set {_xloc} to x location of {_exception}
		set {_yloc} to y location of {_exception}
		set {_zloc} to z location of {_exception}
		set {_pitch} to ({_exception}'s location).getPitch()
		set {_yaw} to ({_exception}'s location).getYaw()
		set {_fYaw} to {_yaw}*256/360
		set {_fPitch} to {_pitch}*256/360
		set {_packet} to new play_server_spawn_entity_living packet #Same as the disguise command
		set int pnum 0 of {_packet} to {_eId} 
		set uuid field 0 of {_packet} to "%{_uuid}%" 
		set int pnum 1 of {_packet} to {DM::HIDDENDisguise::%player.getEntityId()%} 
		set double pnum 0 of {_packet} to {_xloc}
		set double pnum 1 of {_packet} to {_yloc}
		set double pnum 2 of {_packet} to {_zloc}
		set int pnum 2 of {_packet} to 0
		set int pnum 3 of {_packet} to 0
		set int pnum 4 of {_packet} to 0
		set byte pnum 0 of {_packet} to {_fYaw} 
		set byte pnum 1 of {_packet} to {_fPitch} 
		set byte pnum 2 of {_packet} to {_fYaw}
		if {@Name} is true:
			set watched string 2 of data watcher field 0 of {_packet} to "%{_exception}%"
		if {DM::HIDDENForAll::%player.getEntityId()%} is true:
			loop all players in radius 50 around {_exception}:
				loop-player is not {_exception}
				send packet {_packet} to loop-player
				UpdateStuff(player, loop-player)
		if {DM::HIDDENForAll::%player.getEntityId()%} is true:
			loop all players in radius 50 around {_exception}: 
				{DM::HiddenList::%player.getEntityId()%::*} contains loop-player
				loop-player is not {_exception}
				send packet {_packet} to loop-player
				UpdateStuff(player, loop-player)
	clear {DM::LeftHiddenDisguise::%uuid of player%}
	clear {DM::LeftHiddenForAll::%uuid of player%}
	clear {DM::LeftHiddenList::%uuid of player%::*}
command /undisguise [<offline player>]:
	permission: self.undisguise
	permission message: &cYou don't have the permission to execute this command
	usage: &4Syntaxe &b» &3/undisguise [<player>]
	trigger:
		set {_undisguise} to player
		if arg-1 is set:
			if player doesn't have permission "other.undisguise":
				send "&6DisguiseMe &b» &cYou don't have the permission to remove a player's disguise!"
				send "&4Syntax &b» &3/undisguise"
				stop
			if arg-1 is offline:
				if {DM::LeftHiddenDisguise::%uuid of arg-1%} is set:
					clear {DM::LeftHiddenDisguise::%uuid of arg-1%}
					clear {DM::LeftHiddenForAll::%uuid of arg-1%}
					clear {DM::LeftHiddenList::%uuid of arg-1%::*}
					send "&6DisguiseMe &b» &3%arg 1%&a &cwon't be &adisguised the next time he joins!" 
					stop
				send "&6DisguiseMe &b» &3%arg 1% &cwas not disguised !" 
				stop
			set {_undisguise} to arg-1
		set {_uuid} to uuid of {_undisguise} #Skript gives an error if I try to do it in 1 line
		set {_EId} to {_undisguise}.getEntityId() #Same
		if {DM::HIDDENPlayer::%{_uuid}%} is true:
			clear {DM::HIDDENPlayer::%{_uuid}%}
			clear {DM::HIDDENUUID::%{_EId}%}
			clear {DM::HIDDENId::%{_EId}%}
			clear {DM::HIDDENDisguise::%{_EId}%}
			clear {DM::HiddenList::%{_EId}%::*}
			if arg-1 is not set:
				send "&6DisguiseMe &b» &3You&a are &cnot &adisguised &canymore !"
			if arg-1 is set:
				send "&6DisguiseMe &b» &3%{_undisguise}%&a is &cnot &adisguised &canymore !"
			if {@UpdateHead} is true:
				set {_packetHead} to new play_server_entity_head_rotation packet
				set int field 0 of {_packetHead} to {_undisguise}.getEntityId()
				set {_yaw} to ({_undisguise}'s location).getYaw()
				set {_fYaw} to round({_yaw}*256/360) 
				set byte field 0 of {_packetHead} to {_fyaw}
			set {_playerlist::*} to all players in radius 50 around {_undisguise} #Allows me to have a wait without looping again
			remove {_undisguise} from {_playerlist::*}
			hide {_undisguise} from {_playerlist::*} #Send a play_server_named_entity_spawn packet by default, and I don't have anything to do there lmao
			reveal {_undisguise} to {_playerlist::*}
			if {DM::MCVersion} >= 9:
				wait 1 tick
			send packet {_packetHead} to {_playerlist::*}
			if {@UpdateStuff} is true:
				if {DM::MCVersion} >= 16:
					UpdateStuff16({_undisguise}, {_playerlist::*})
				if {DM::MCVersion} <= 15:
					UpdateStuff({_undisguise}, {_playerlist::*})
		else:
			if arg-1 is not set:
				send "&6DisguiseMe &b» &3You &care not disguised !"
			if arg-1 is set:
				send "&6DisguiseMe &b» &3%arg 1% &cis not disguised !" 
			if player has permission "other.undisguise":
				send "&3Remove a player's disguise &7» &b/undisguise <player>"
			send "&3Remove your disguise &7» &b/undisguise"
on packet event play_server_named_entity_spawn: #Show the disguise when a player comes into visible range
	if {DM::HIDDENid::%int pnum 0 of event-packet%} is set:
		if {DM::HIDDENForAll::%int pnum 0 of event-packet%} is false:
			{DM::HiddenList::%int pnum 0 of event-packet%::*} doesn't contain player:
				stop
		if {DM::MCVersion} is 9 or 10 or 11:
			if difference between {DM::LastJoin::%{DM::HIDDENId::%int pnum 0 of event-packet%}%} and now < 1 seconds: #Prevent nearby players from crashing in 1.9/10/11
				stop
		cancel event
		set {_packet} to new play_server_spawn_entity_living packet
		if {DM::MCVersion} >= 9:
			set int pnum 0 of {_packet} to int pnum 0 of event-packet #EID
			set uuid field 0 of {_packet} to "%{DM::HIDDENUUID::%int pnum 0 of event-packet%}%" 
			set int pnum 1 of {_packet} to {DM::HIDDENDisguise::%int pnum 0 of event-packet%} 
			set double pnum 0 of {_packet} to double pnum 0 of event-packet
			set double pnum 1 of {_packet} to double pnum 1 of event-packet
			set double pnum 2 of {_packet} to double pnum 2 of event-packet
			set int pnum 2 of {_packet} to 0
			set int pnum 3 of {_packet} to 0
			set int pnum 4 of {_packet} to 0
			set byte pnum 0 of {_packet} to byte pnum 0 of event-packet
			set byte pnum 1 of {_packet} to byte pnum 1 of event-packet
			set byte pnum 2 of {_packet} to byte pnum 0 of event-packet
		if {DM::MCVersion} <= 8:
			set int pnum 0 of {_packet} to int pnum 0 of event-packet #EID
			set int pnum 1 of {_packet} to {DM::HIDDENDisguise::%int pnum 0 of event-packet%}  #Type of mob 
			set int pnum 2 of {_packet} to int pnum 1 of event-packet #Pos X
			set int pnum 3 of {_packet} to int pnum 2 of event-packet #Pos Y
			set int pnum 4 of {_packet} to int pnum 3 of event-packet #Pos Z
			set int pnum 5 of {_packet} to 0 #velocity x
			set int pnum 6 of {_packet} to 0 #velocity y
			set int pnum 7 of {_packet} to 0 #velocity z
			set byte pnum 0 of {_packet} to {DM::HIDDENId::%int pnum 0 of event-packet%}'s yaw * 256 / 360 
			set byte pnum 1 of {_packet} to {DM::HIDDENId::%int pnum 0 of event-packet%}'s pitch * 256 / 360
			set byte pnum 2 of {_packet} to {DM::HIDDENId::%int pnum 0 of event-packet%}'s yaw * 256 / 360 	
		if {@Name} is true:
			if {DM::MCVersion} is 9 or 10 or 11 or 12:
				set watched string 2 of data watcher field 0 of {_packet} to "%{DM::HIDDENId::%int pnum 0 of event-packet%}%"
			else if {DM::MCVersion} <= 8:
				set {_name} to "%{DM::HIDDENId::%int pnum 0 of event-packet%}%"
				set {_WDW} to new WrappedDataWatcher() #So people actually read the comments I make, Kappa
				{_WDW}.setObject(2 and {_name}) #Same as in the disguise command
				set data watcher field 0 of {_packet} to {_WDW}
			else if {DM::MCVersion} is 13:
				set {_name} to Optional.of(new ChatComponentText("%{DM::HIDDENId::%int pnum 0 of event-packet%}%"))
				set {_WDW} to new WrappedDataWatcher()
				set {_Serializer} to DWReg.getChatComponentSerializer(true) 
				set {_Dw} to new DWObject(2 and {_Serializer})
				{_WDW}.setObject({_Dw} and {_name})		
				set data watcher field 0 of {_packet} to {_WDW}
			else: #1.14 -> 1.16+
				set {_packetMeta} to new play_server_entity_metadata packet
				set int pnum 0 of {_packetMeta} to int pnum 0 of event-packet
				set {_name} to Optional.of(new ChatComponentText("%{DM::HIDDENId::%int pnum 0 of event-packet%}%"))
				set {_WDW} to new WrappedDataWatcher()
				set {_Serializer} to DWReg.getChatComponentSerializer(true)
				set {_Dw} to new DWObject(2 and {_Serializer})
				{_WDW}.setObject({_Dw} and {_name})		
				set watchable collection field 0 of {_packetMeta} to {_WDW}
		send packet {_packet} to player
		send packet {_packetMeta} to player
		if {@UpdateStuff} is true:
			if {DM::MCVersion} >= 16:
				UpdateStuff16({DM::IdToPlayer::%int pnum 0 of event-packet%}, player)
			if {DM::MCVersion} <= 15:
				UpdateStuff({DM::IdToPlayer::%int pnum 0 of event-packet%}, player)
	else:
		if {@UpdateHead} is true:
			wait 1 tick
			set {_packetHead} to new play_server_entity_head_rotation packet
			set int field 0 of {_packetHead} to int field 0 of event-packet
			set {_yaw} to ({DM::IdToPlayer::%int pnum 0 of event-packet%}'s location).getYaw()
			set {_fYaw} to round({_yaw}*256/360) 
			set byte field 0 of {_packetHead} to {_fYaw}
			send packet {_packetHead} to player
		if {@UpdateStuff} is true:
			if {DM::MCVersion} >= 16:
				UpdateStuff16({DM::IdToPlayer::%int pnum 0 of event-packet%}, player)
			if {DM::MCVersion} <= 15:
				UpdateStuff({DM::IdToPlayer::%int pnum 0 of event-packet%}, player)
		if {@SkinReload} is true:
			SkinReload({DM::IdToPlayer::%int pnum 0 of event-packet%})
on packet event play_client_settings: #Save the informations to use them later, with the function SkinReload 
	{DM::MCVersion} >= 15
	set {DM::HiddenPSettings::%player%::Lang} to string field 0 of event-packet
	set {DM::HiddenPSettings::%player%::View} to int field 0 of event-packet
	set {DM::HiddenPSettings::%player%::ChatVisibility} to chatvisibility field 0 of event-packet
	set {DM::HiddenPSettings::%player%::ChatColor} to boolean field 0 of event-packet
	set {DM::HiddenPSettings::%player%::Skin} to int field 1 of event-packet
	set {DM::HiddenPSettings::%player%::Hand} to object field 5 of event-packet #hand field 0 of event-packet doesn't work in 1.15/1.16, so it must be stored as an object (sadly)

#Functions: API
#These functions are pretty similar to the code above, so I won't comment much here
#Check https://phe0x.fr/DisguiseMe/Functions.html (ugly but readable)
function Disguise(p: players, mob: string, ForAll: boolean, ToPlayers: players) :: int: #Disguise( players to disguise, "mob", True if for all players/false otherwise, Players that will see the disguise |MUST BE FILLED EVEN IF YOU PUT TRUE FOR ALL PLAYERS, IT WONT BE USED|)									#Exemple: CF SkriptMC
	set {_id} to MobToId({_mob})
	if {DM::MCVersion} <= 12:	
		set {_id} to MobToId12({_mob}) 
	if {DM::MCVersion} >= 16:	
		set {_id} to MobToId16({_mob})
		if {DM::MCSubVersion} > 1:
			if {_id} >= 61:
				add 1 to {_id}
			if {_id} = -10:
				set {_id} to 61 #Piglin brute
		if {DM::MCVersion} >= 17:
			if {_id} >= 61: #We never knows lmao
				add 1 to {_id}
			if {_id} = -10:
				set {_id} to 61 
	if {_id} is -1:
		send "&c[DisguiseMe] Function called with a mob &b%{_mob}%&c that doesn't exist !" to console
		return 0
		stop
	if {_id} is -5:
		send "&c[Diguise] Function called with a mob &b(%{_mob}%) &cthat doesn't exist in this version &d(%{DM::MCVersion}%&d)" to console
		return 0
		stop
	if {_id} is -6:
		send "&c[Diguise] Function called with a mob &b(%{_mob}%) &cthat was removed ! &d(%{DM::MCVersion}%&d)" to console
		return 0
		stop
	if {DM::MCVersion} is 15:
		if {_mob} is not "{@ArmorStand}" or "{@Bat}" or "{@Bee}":
			add 1 to {_id}
	if {DM::MCVersion} is 13:
		if {_mob} is "{@ArmorStand}" or "{@Bat}" or "{@Blaze}":
			set {_id} to {_id}
		else if {_mob} is "{@Cave_Spider}" or "{@Chicken}" or "{@Cod}" or "{@Cow}" or "{@Cow}" or "{@Creeper}" or "{@Donkey}" or "{@Dolphin}" or "{@Drowned}" or "{@Elder_Guardian}" or "{@Ender_Dragon}" or "{@Enderman}" or "{@Endermite}" or "{@Evoker}" or "{@Magma_Cube}":
			remove 1 from {_id}
		else if {_mob} is "{@Ghast}" or "{@Giant}" or "{@Guardian}" or "{@Horse}" or "{@Husk}" or "{@Illusioner}" or "{@Llama}" or "{@Mule}" or "{@Mooshroom}" or "{@Ocelot}":
			remove 2 from {_id}
		else if {_mob} is "{@Parrot}" or "{@Pig}" or "{@PufferFish}" or "{@Zombie_Pigman}" or "{@Polar_Bear}" or "{@Rabbit}" or "{@Salmon}" or "{@Sheep}" or "{@Shulker}" or "{@SilverFish}" or "{@Skeleton}" or "{@Skeleton_Horse}" or "{@Slime}" or "{@Snow_Golem}" or "{@Spider}" or "{@Squid}" or "{@Stray}":
			remove 3 from {_id}
		else if {_mob} is "{@Tropical_Fish}" or "{@Turtle}":
			remove 4 from {_id}
		else if {_mob} is "{@Vex}" or "{@Villager}" or "{@Iron_Golem}" or "{@Vindicator}":
			remove 5 from {_id}
		else:
			remove 7 from {_id}
	loop {_p::*}:
		clear {_pass}
		set {_exception} to loop-value
		set {_packet} to new play_server_spawn_entity_living packet
		set {_eId} to {_exception}.getEntityId()
		set {_uuid} to {_exception}'s uuid
		set {_xloc} to x location of {_exception}
		set {_yloc} to y location of {_exception}
		set {_zloc} to z location of {_exception}
		set {_pitch} to ({_exception}'s location).getPitch()
		set {_yaw} to ({_exception}'s location).getYaw()
		set {_fYaw} to {_yaw}*256/360 
		set {_fPitch} to {_pitch}*256/360
		if {DM::MCVersion} >= 9:
			set int pnum 0 of {_packet} to {_eId} #EID
			set uuid field 0 of {_packet} to "%{_uuid}%" #E UUID
			set int pnum 1 of {_packet} to {_id} #Type of mob
			set double pnum 0 of {_packet} to {_xloc}
			set double pnum 1 of {_packet} to {_yloc}
			set double pnum 2 of {_packet} to {_zloc}
			set int pnum 2 of {_packet} to 0
			set int pnum 3 of {_packet} to 0
			set int pnum 4 of {_packet} to 0
			set byte pnum 0 of {_packet} to {_fYaw} #arg-1's yaw
			set byte pnum 1 of {_packet} to {_fPitch} #
			set byte pnum 2 of {_packet} to {_fYaw}
		if {DM::MCVersion} <= 8:
			set int pnum 0 of {_packet} to {_eId} #EID
			set int pnum 1 of {_packet} to {_id} #Type of mob
			set int pnum 2 of {_packet} to {_xloc}*32 #Pos X
			set int pnum 3 of {_packet} to {_yloc}*32 #Pos Y
			set int pnum 4 of {_packet} to {_zloc}*32 #Pos Z
			set int pnum 5 of {_packet} to 0 
			set int pnum 6 of {_packet} to 0 
			set int pnum 7 of {_packet} to 0 
			set byte pnum 0 of {_packet} to {_fYaw} 
			set byte pnum 1 of {_packet} to {_fPitch} 
			set byte pnum 2 of {_packet} to {_fYaw} 
		if {@Name} is true:
			if {DM::MCVersion} is 9 or 10 or 11 or 12:
				set watched string 2 of data watcher field 0 of {_packet} to "%{_exception}%" 
			else if {DM::MCVersion} is 13:
				set {_name} to Optional.of(new ChatComponentText("%{_exception}%"))
				set {_WDW} to new WrappedDataWatcher() 
				set {_Serializer} to DWReg.getChatComponentSerializer(true)
				set {_Dw} to new DWObject(2 and {_Serializer})
				{_WDW}.setObject({_Dw} and {_name})		
				set data watcher field 0 of {_packet} to {_WDW}
			else if {DM::MCVersion} <= 8:
				set {_name} to "%{_exception}%"
				set {_WDW} to new WrappedDataWatcher()
				{_WDW}.setObject(2 and {_name})	
				set data watcher field 0 of {_packet} to {_WDW}
			else: 
				set {_packetMeta} to new play_server_entity_metadata packet
				set int pnum 0 of {_packetMeta} to {_exception}.getEntityId()
				set {_name} to Optional.of(new ChatComponentText("%{_exception}%"))
				set {_WDW} to new WrappedDataWatcher() 
				set {_Serializer} to DWReg.getChatComponentSerializer(true)
				set {_Dw} to new DWObject(2 and {_Serializer})
				{_WDW}.setObject({_Dw} and {_name})		
				set watchable collection field 0 of {_packetMeta} to {_WDW}
		loop all players in radius 50 around {_exception}: 
			clear {_pass}
			if {_ForAll} is false: #Could be optimized by sending the packet to everyone that see the disguise (if there is only a few players)
				if {_ToPlayers::*} doesn't contain loop-player: #A protection to avoid the players being soft lock
					set {_pass} to false
			{_pass} is not false
			loop-player is not {_exception}
			send packet {_packet} to loop-player
			send packet {_packetMeta} to loop-player
			if {@UpdateStuff} is true:
				if {DM::MCVersion} >= 16:
					UpdateStuff16({_exception}, loop-player)
				if {DM::MCVersion} <= 15:
					UpdateStuff({_exception}, loop-player)
		set {DM::HIDDENPlayer::%{_uuid}%} to true
		set {DM::HIDDENUUID::%{_eId}%} to {_uuid}
		set {DM::HIDDENId::%{_eId}%} to {_exception}
		set {DM::HIDDENDisguise::%{_eId}%} to {_id}
		if {_ForAll} is false:
			set {DM::HIDDENForAll::%{_eId}%} to false
			set {DM::HiddenList::%{_eId}%::*} to {_ToPlayers::*}
		if {_ForAll} is true:
			set {DM::HIDDENForAll::%{_eId}%} to true
			clear {DM::HiddenList::%{_eId}%::*} 
	return 1
function Undisguise(p: offline players):
	loop {_p::*}:
		if loop-value is online:
			set {_EId} to loop-value.getEntityId()
			clear {DM::HIDDENPlayer::%uuid of loop-value%}
			clear {DM::HIDDENUUID::%{_EId}%}
			clear {DM::HIDDENId::%{_EId}%}
			clear {DM::HIDDENDisguise::%{_EId}%}
			if {@UpdateHead} is true:
				set {_packetHead} to new play_server_entity_head_rotation packet
				set int field 0 of {_packetHead} to {_EId}
				set {_yaw} to (loop-value's location).getYaw()
				set {_fYaw} to round({_yaw}*256/360)
				set byte field 0 of {_packetHead} to {_fyaw}
			set {_playerlist::*} to all players in radius 50 around loop-value
			hide loop-value-1 from {_playerlist::*} 
			reveal loop-value-1 to {_playerlist::*}
			if {@UpdateStuff} is true:
				if {DM::MCVersion} >= 16:
					UpdateStuff16(loop-value, {_playerlist::*})
				if {DM::MCVersion} <= 15:
					UpdateStuff(loop-value, {_playerlist::*})
			wait 1 tick
			send packet {_packetHead} to {_playerlist::*}
			clear {DM::HiddenList::%{_EId}%::*}
			clear {DM::HIDDENForAll::%{_EId}%}
		else:
			set {_uuid} to uuid of loop-value
			clear {DM::LeftHiddenDisguise::%{_uuid}%}
			clear {DM::LeftHiddenForAll::%{_uuid}%}
			clear {DM::LeftHiddenList::%{_uuid}%::*}
function UndisguiseOnline(p: players):
	loop {_p::*}: 
		set {_EId} to loop-value.getEntityId()
		clear {DM::HIDDENPlayer::%uuid of loop-value%}
		clear {DM::HIDDENUUID::%{_EId}%}
		clear {DM::HIDDENId::%{_EId}%}
		clear {DM::HIDDENDisguise::%{_EId}%}
		if {@UpdateHead} is true:
			set {_packetHead} to new play_server_entity_head_rotation packet
			set int field 0 of {_packetHead} to {_EId}
			set {_yaw} to (loop-value's location).getYaw()
			set {_fYaw} to round({_yaw}*256/360) 
			set byte field 0 of {_packetHead} to {_fyaw}
		set {_playerlist::*} to all players in radius 50 around loop-value
		hide loop-value-1 from {_playerlist::*} 
		reveal loop-value-1 to {_playerlist::*} 
		if {@UpdateStuff} is true:
			if {DM::MCVersion} >= 16:
				UpdateStuff16(loop-value, {_playerlist::*})
			if {DM::MCVersion} <= 15:
				UpdateStuff(loop-value, {_playerlist::*})
		wait 1 tick
		send packet {_packetHead} to {_playerlist::*}
		clear {DM::HiddenList::%{_EId}%::*}
		clear {DM::HIDDENForAll::%{_EId}%}
function UndisguiseOffline(p: offline players): #Having both is better since it's less checks (and faster, because Skript doesn't like offline players)
	loop {_p::*}:
		set {_uuid} to uuid of loop-value
		clear {DM::LeftHiddenDisguise::%{_uuid}%}
		clear {DM::LeftHiddenForAll::%{_uuid}%}
		clear {DM::LeftHiddenList::%{_uuid}%::*}
function IsDisguise(p: offline players) :: boolean:
	loop {_p::*}:
		if {DM::HIDDENPlayer::%uuid of loop-value%} is not true:
			if {DM::LeftHiddenDisguise::%uuid of loop-value%} is not true:
				return false
				stop
	return true
function IsDisguiseOnline(p: players) :: boolean: #Don't use offline players if it's not necessary
	loop {_p::*}:
		if {DM::HIDDENPlayer::%uuid of loop-value%} is not true:
			return false
			stop
	return true
function IsDisguiseOffline(p: offline players) :: boolean:
	loop {_p::*}:
		if {DM::LeftHiddenDisguise::%uuid of loop-value%} is not true:
			return false
			stop
	return true