# ================================================= # Pets # Developed by SweatyBufalo # Requires SkBee & luckperms plugin # Discord is sweatyBufalo#9780 # This skript isn't all my own work some of it came from various pets skripts # ================================================= options: # These options configure the settings used in the game. Make sure to only change the text after the colon. # Prefix - We recommend you set this to your server's name. This will prefix most messages. Hex codes are available for 1.16+ prefix: &c&lTokyo&f&lGens &7» # Permission - The permissions required to use certain commands/functions # Generic permission to access menu and manage your pet perm: pets.use # Admin Permission - Permission needed to utilize admin commands for managing pets server-wide adminperm: pets.admin # Sound - The sound played when interacting with things # A valid sound list can be found here: http://www.theredengineer.com/1.9-playsound-list.html sound: block.note_block.pling # Buff toggle - Select whether bonuses should be applied when pets are active # Set to a boolean; true or false buffs: true # Bonuses - The buff applied when a pet is active. Can be toggled off with the option above # A valid effect list can be found here: https://skripthub.net/docs/?id=2161 hare: haste cheetah: speed elephant: strength crocodile: resistance # ================================================= # Pets Code # Do not edit anything below unless you know what you're doing # # Note for people acquainted with Skript: The spawnPet() function is not hard-coded. Feel free to make your own pet menu - see lines below: # Simply define an online player, skull-ID & name; the defined pet will spawn. # Format: spawnPet(player, "SkullID", "name") # If you're looking to get proper skull IDs, https://freshcoal.com/maincollection has a great list of heads. Just copy the correct portion of the NBT tag. # Just make sure to double the quotations! # ================================================= on tab complete of "/pets": set tab completions for position 1 to "help", "menu", "despawn" and "clearall" command /pets []: permission: {@perm} permission message: &cYou lack the required permissions! trigger: if arg-1 is not set: petsMenu(player) else if arg-1 is "menu": petsMenu(player) else if arg-1 is "despawn": if {ultimatepets::parrots::%uuid of player%} is set: kill {ultimatepets::armorstands::%uuid of player%} kill {ultimatepets::parrots::%uuid of player%} delete {ultimatepets::armorstands::%uuid of player%} delete {ultimatepets::parrots::%uuid of player%} send "{@prefix} &aYour pet has been released into the wild." play sound "{@sound}" at volume 0.75 with pitch 1.4 to player resetEffects(player, "all") else: send "{@prefix} &cYou do not currently have a pet." play sound "{@sound}" at volume 0.75 with pitch 0.7 to player else if arg-1 is "clearall": if player has permission "{@adminperm}": clearPets() else: send "&cYou lack the required permission!" play sound "{@sound}" at volume 0.75 with pitch 0.7 to player else if arg-1 is "help": send "%nl%{@prefix} &aPets Help%nl%&7%nl%&8| &e/pets help &7- &eBrings up this help page%nl%&8| &e/pets menu &7- &eOpen the pets menu%nl%&8| &e/pets despawn &7- &eDespawns your active pet%nl%&8| &e/pets clearall &7- &eForce-clears all pets%nl%" play sound "{@sound}" at volume 0.75 with pitch 1.4 to player else: send "{@prefix} &cThis is not a valid syntax. Correct usage: &7&o/pets " play sound "{@sound}" at volume 0.75 with pitch 0.7 to player on chat: if event is not cancelled: if {ultimatepets::choosing::%uuid of player%} is set: if message does not contain " ": if message is "cancel": delete {ultimatepets::choosing::%uuid of player%} send "{@prefix} &aPet selection successfully disabled." play sound "{@sound}" at volume 0.75 with pitch 1.4 to {_p} else: delete {ultimatepets::choosing::%uuid of player%} spawnPet(player, "custom, no ID needed", message) play sound "{@sound}" at volume 0.75 with pitch 1.4 to {_p} else: send "{@prefix} &cYou cannot have spaces in the pet ID." play sound "{@sound}" at volume 0.75 with pitch 0.7 to {_p} cancel event on inventory click: if event-inventory is (metadata tag "petsMenu" of player): cancel event # HARE if index of event-slot is 11: if player has permission "pets.hare": spawnPet(player, "{display:{Name:""Pet""},SkullOwner:{Id:""10a9980c-1ba4-42fc-9f92-96b65a1db4b9"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTE3YmZmYzE5NzJhY2Q3ZjNiNGE4ZjQzYjViNmM3NTM0Njk1YjhmZDYyNjc3ZTAzMDZiMjgzMTU3NGIifX19""}]}}}", "Hare") close inventory of player else: send "&cYou do not own this pet!" to player close inventory of player # CHEETAH else if index of event-slot is 12: if player has permission "pets.cheetah": spawnPet(player, "{display:{Name:""Pet""},SkullOwner:{Id:[I;-530976352,-1369878771,-1840002999,-2118654106],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODkwYzZjZTA1NzRiNmI5MDlhOTRhYjNhYTBhZmFiOTVlNmI5MzU2MWI0ZWEyNTVlYjcwMTE3ZDg0ZTUyMzM4MyJ9fX0=""}]}}}", "Cheetah") close inventory of player else: send "&cYou do not own this pet!" to player close inventory of player # ELEPHANT else if index of event-slot is 14: if player has permission "pets.elephant": spawnPet(player, "{display:{Name:""Pet""},SkullOwner:{Id:[I;-1705450918,-817412995,-1321451869,1858927153],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzA3MWE3NmY2NjlkYjVlZDZkMzJiNDhiYjJkYmE1NWQ1MzE3ZDdmNDUyMjVjYjMyNjdlYzQzNWNmYTUxNCJ9fX0=""}]}}}", "Elephant") close inventory of player else: send "&cYou do not own this pet!" to player close inventory of player # CROCODILE else if index of event-slot is 15: if player has permission "pets.crocodile": spawnPet(player, "{display:{Name:""Pet""},SkullOwner:{Id:[I;436660023,-1001306100,-1250720703,-907824705],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmJmMjRkMGJmMDQ1MzQyMmEwYTUyNzViNWE1NDUwNTk3MDUzMDljZDVjMmRhM2EzMGY3MTkxODYyYjc2ZDA1OSJ9fX0=""}]}}}", "Crocodile") close inventory of player else: send "&cYou do not own this pet!" to player close inventory of player else if index of event-slot is 22: if {ultimatepets::parrots::%uuid of player%} is set: kill {ultimatepets::armorstands::%uuid of player%} kill {ultimatepets::parrots::%uuid of player%} delete {ultimatepets::armorstands::%uuid of player%} delete {ultimatepets::parrots::%uuid of player%} send "{@prefix} &aYour pet has been released into the wild." play sound "{@sound}" at volume 0.75 with pitch 1.4 to player resetEffects(player, "all") else: send "{@prefix} &cYou do not currently have a pet." play sound "{@sound}" at volume 0.75 with pitch 0.7 to player function petsMenu(p: player): play sound "{@sound}" at volume 0.75 with pitch 1.4 to {_p} set metadata tag "petsMenu" of {_p} to chest inventory with 3 rows named "<##798efb>&lP<##a487ef>&le<##d080e3><<##fb79d7>&ls" set slot (integers between 0 and 27) of metadata tag "petsMenu" of {_p} to gray stained glass pane named "&7" set slot 22 of metadata tag "petsMenu" of {_p} to structure void named "&cClear Pet" with lore "<##717171>Despawn your active pet." if {@buffs} = true: if {_p} has permission "pets.hare": set slot 11 of (metadata tag "petsMenu" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;279549964,463749884,-1617783114,1511896249],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTE3YmZmYzE5NzJhY2Q3ZjNiNGE4ZjQzYjViNmM3NTM0Njk1YjhmZDYyNjc3ZTAzMDZiMjgzMTU3NGIifX19""}]}}}" named "&3&lHARE PET" with lore "&3&l ┃ &bDescription:" and "&3&l ┃ &fGives haste effect while active." and and "&7" and "&3&l ┃ &bLevel: &f%{pets::level::hare::%player%}%&8/&f10" and "&3&l ┃ &bExperience:&f%{pets::xp::hare::%player%}%&8/&f{pets::xpmax::hare::%player%}" and "&7" and "&8Click to equip" else: set slot 11 of (metadata tag "petsMenu" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;279549964,463749884,-1617783114,1511896249],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTE3YmZmYzE5NzJhY2Q3ZjNiNGE4ZjQzYjViNmM3NTM0Njk1YjhmZDYyNjc3ZTAzMDZiMjgzMTU3NGIifX19""}]}}}" named "<##fb4f4f>&lHare" with lore "&7", "" and "<##BFBFBF>Applies <##00FF8B>{@hare}<##BFBFBF> while active." and "&7" if {_p} has permission "pets.cheetah": set slot 12 of (metadata tag "petsMenu" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;-530976352,-1369878771,-1840002999,-2118654106],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODkwYzZjZTA1NzRiNmI5MDlhOTRhYjNhYTBhZmFiOTVlNmI5MzU2MWI0ZWEyNTVlYjcwMTE3ZDg0ZTUyMzM4MyJ9fX0=""}]}}}" named "&3&lCHEETAH PET" with lore "&3&l ┃ &bDescription:" and "&3&l ┃ &fGives speed effect while active." and and "&7" and "&3&l ┃ &bLevel: &f%{pets::level::cheetah::%player%}%&8/&f10" and "&3&l ┃ &bExperience:&f%{pets::xp::cheetah::%player%}%&8/&f{pets::xpmax::cheetah::%player%}" and "&7" and "&8Click to equip" else: set slot 12 of (metadata tag "petsMenu" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;-530976352,-1369878771,-1840002999,-2118654106],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODkwYzZjZTA1NzRiNmI5MDlhOTRhYjNhYTBhZmFiOTVlNmI5MzU2MWI0ZWEyNTVlYjcwMTE3ZDg0ZTUyMzM4MyJ9fX0=""}]}}}" named "<##00D1FF>Cheetah" with lore "&7", "<##717171>Summon the Cheetah pet." and "<##BFBFBF>Applies <##00FF8B>{@cheetah}<##BFBFBF> while active." and "&7" if {_p} has permission "pets.elephant": set slot 14 of (metadata tag "petsMenu" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;-1705450918,-817412995,-1321451869,1858927153],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzA3MWE3NmY2NjlkYjVlZDZkMzJiNDhiYjJkYmE1NWQ1MzE3ZDdmNDUyMjVjYjMyNjdlYzQzNWNmYTUxNCJ9fX0=""}]}}}" named "&3&lELEPHANT PET" with lore "&3&l ┃ &bDescription:" and "&3&l ┃ &fGives strength effect while active." and and "&7" and "&3&l ┃ &bLevel: &f%{pets::level::elephant::%player%}%&8/&f10" and "&3&l ┃ &bExperience:&f%{pets::xp::elephant::%player%}%&8/&f{pets::xpmax::elephant::%player%}" and "&7" and "&8Click to equip" else: set slot 14 of (metadata tag "petsMenu" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;-1705450918,-817412995,-1321451869,1858927153],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzA3MWE3NmY2NjlkYjVlZDZkMzJiNDhiYjJkYmE1NWQ1MzE3ZDdmNDUyMjVjYjMyNjdlYzQzNWNmYTUxNCJ9fX0=""}]}}}" named "<##00D1FF>Elephant" with lore "&7", "<##717171>Summon the Elephant pet." and "<##BFBFBF>Applies <##00FF8B>{@elephant}<##BFBFBF> while active." and "&7" if {_p} has permission "pets.crocodile": set slot 15 of (metadata tag "petsMenu" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;436660023,-1001306100,-1250720703,-907824705],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmJmMjRkMGJmMDQ1MzQyMmEwYTUyNzViNWE1NDUwNTk3MDUzMDljZDVjMmRhM2EzMGY3MTkxODYyYjc2ZDA1OSJ9fX0=""}]}}}" named "&3&lCROCODILE PET" with lore "&3&l ┃ &bDescription:" and "&3&l ┃ &fGives resistance effect while active." and and "&7" and "&3&l ┃ &bLevel: &f%{pets::level::crocodile::%player%}%&8/&f10" and "&3&l ┃ &bExperience:&f%{pets::xp::crocodile::%player%}%&8/&f{pets::xpmax::crocodile::%player%}" and "&7" and "&8Click to equip" else: set slot 15 of (metadata tag "petsMenu" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;436660023,-1001306100,-1250720703,-907824705],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmJmMjRkMGJmMDQ1MzQyMmEwYTUyNzViNWE1NDUwNTk3MDUzMDljZDVjMmRhM2EzMGY3MTkxODYyYjc2ZDA1OSJ9fX0=""}]}}}" named "&3&lCROCODILE PET" with lore "&7", "<##717171>Summon the Crocodile pet." and "<##BFBFBF>Applies <##00FF8B>{@crocodile}<##BFBFBF> while active." and "&7" open (metadata tag "petsMenu" of {_p}) to {_p} function petsTrader(p: player): play sound "{@sound}" at volume 0.75 with pitch 1.4 to {_p} set metadata tag "petsTrader" of {_p} to chest inventory with 5 rows named "&fPet Trader" set slot (integers between 0 and 44) of metadata tag "petsTrader" of {_p} to gray stained glass pane named "&7" set slot 40 of metadata tag "petsTrader" of {_p} to structure void named "&cClose" set slot 20 of (metadata tag "petsTrader" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;279549964,463749884,-1617783114,1511896249],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTE3YmZmYzE5NzJhY2Q3ZjNiNGE4ZjQzYjViNmM3NTM0Njk1YjhmZDYyNjc3ZTAzMDZiMjgzMTU3NGIifX19""}]}}}" named "&3&lHARE PET" with lore "&3&l ┃ &bDescription:" and "&3&l ┃ &fGives haste effect while active." and "&7" and "&3&l ┃ &bCost:" and "&3&l ┃ <##fb4f4f>✮30k" and "&3&l ┃ &f16x Enchanted Wheat" and "&3&l ┃ &f16x Enchanted Carrot" and "&3&l ┃ &f16x Enchanted potato" and "&f" and "&8Click to buy" set slot 21 of (metadata tag "petsTrader" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;-530976352,-1369878771,-1840002999,-2118654106],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODkwYzZjZTA1NzRiNmI5MDlhOTRhYjNhYTBhZmFiOTVlNmI5MzU2MWI0ZWEyNTVlYjcwMTE3ZDg0ZTUyMzM4MyJ9fX0=""}]}}}" named "&3&lCHEETAH PET" with lore "&3&l ┃ &bDescription:" and "&3&l ┃ &fGives speed effect while active." and "&7" and "&3&l ┃ &bCost:" and "&3&l ┃ <##fb4f4f>✮30k" and "&3&l ┃ &f32x Enchanted Wheat" and "&3&l ┃ &f32x Enchanted Carrot" and "&3&l ┃ &f32x Enchanted Potato" and "&3&l ┃ &f32x Enchanted Nether wart" and "&f" and "&8Click to buy" set slot 23 of (metadata tag "petsTrader" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;-1705450918,-817412995,-1321451869,1858927153],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzA3MWE3NmY2NjlkYjVlZDZkMzJiNDhiYjJkYmE1NWQ1MzE3ZDdmNDUyMjVjYjMyNjdlYzQzNWNmYTUxNCJ9fX0=""}]}}}" named "&3&lELEPHANT PET" with lore "&3&l ┃ &bDescription:" and "&3&l ┃ &fGives strength effect while active." and "&7" and "&3&l ┃ &bCost:" and "&3&l ┃ <##fb4f4f>✮100k" and "&3&l ┃ &f32x Enchanted Wheat" and "&3&l ┃ &f32x Enchanted Carrot" and "&3&l ┃ &f32x Enchanted potato" and "&3&l ┃ &f32x Enchanted Nether wart" and "&f" and "&8Click to buy" set slot 24 of (metadata tag "petsTrader" of {_p}) to skull of {_p} with nbt "{display:{Name:""Pet""},SkullOwner:{Id:[I;436660023,-1001306100,-1250720703,-907824705],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmJmMjRkMGJmMDQ1MzQyMmEwYTUyNzViNWE1NDUwNTk3MDUzMDljZDVjMmRhM2EzMGY3MTkxODYyYjc2ZDA1OSJ9fX0=""}]}}}" named "&3&lCROCODILE PET" with lore "&3&l ┃ &bDescription:" and "&3&l ┃ &fGives strength effect while active." and "&7" and "&3&l ┃ &bCost:" and "&3&l ┃ <##fb4f4f>✮100k" and "&3&l ┃ &f32x Enchanted Wheat" and "&3&l ┃ &f32x Enchanted Carrot" and "&3&l ┃ &f32x Enchanted potato" and "&3&l ┃ &f32x Enchanted Nether wart" and "&3&l ┃ &f32x Enchanted Sugar Cane" and "&f" and "&8Click to buy" open (metadata tag "petsTrader" of {_p}) to {_p} on inventory click: if event-inventory is (metadata tag "petsTrader" of player): cancel event if index of event-slot is 20: if player has permission "pets.hare": send "{@prefix} &fYou already own this pet! (/pets)" to player else: if {tokens::%player%} >= 30000: if player has 16 of shiny wheat named "&3&lENCHANTED WHEAT" in their inventory: if player has 16 of shiny carrot named "&3&lENCHANTED CARROT" in their inventory: if player has 16 of shiny potato named "&3&lENCHANTED POTATO" in their inventory: execute console command "lp user %player% permission set pets.hare true" send "&fYou bought the &3&lHARE PET!" to player remove 16 of shiny wheat named "&3&lENCHANTED WHEAT" from player's inventory remove 16 of shiny carrot named "&3&lENCHANTED CARROT" from player's inventory remove 16 of shiny potato named "&3&lENCHANTED POTATO" from player's inventory remove 30000 from {tokens::%player%} close inventory of player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else if index of event-slot is 21: if player has permission "pets.cheetah": send "{@prefix} &fYou already own this pet! (/pets)" to player else: if {tokens::%player%} >= 30000: if player has 32 of shiny wheat named "&3&lENCHANTED WHEAT" in their inventory: if player has 32 of shiny carrot named "&3&lENCHANTED CARROT" in their inventory: if player has 32 of shiny nether wart named "&3&lENCHANTED NETHER WART" in their inventory: if player has 32 of shiny potato named "&3&lENCHANTED POTATO" in their inventory: execute console command "lp user %player% permission set pets.cheetah true" send "&fYou bought the &3&lCHEETAH PET!" to player remove 32 of shiny wheat named "&3&lENCHANTED WHEAT" from player's inventory remove 32 of shiny carrot named "&3&lENCHANTED CARROT" from player's inventory remove 32 of shiny potato named "&3&lENCHANTED POTATO" from player's inventory remove 32 of shiny nether wart named "&3&lENCHANTED NETHER WART" from player's inventory remove 30000 from {tokens::%player%} close inventory of player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else if index of event-slot is 23: if player has permission "pets.elephant": send "{@prefix} &fYou already own this pet! (/pets)" to player else: if {tokens::%player%} >= 100000: if player has 32 of shiny wheat named "&3&lENCHANTED WHEAT" in their inventory: if player has 32 of shiny carrot named "&3&lENCHANTED CARROT" in their inventory: if player has 32 of shiny nether wart named "&3&lENCHANTED NETHER WART" in their inventory: if player has 32 of shiny potato named "&3&lENCHANTED POTATO" in their inventory: execute console command "lp user %player% permission set pets.elephant true" send "&fYou bought the &3&lELEPHANT PET!" to player remove 32 of shiny wheat named "&3&lENCHANTED WHEAT" from player's inventory remove 32 of shiny carrot named "&3&lENCHANTED CARROT" from player's inventory remove 32 of shiny potato named "&3&lENCHANTED POTATO" from player's inventory remove 32 of shiny nether wart named "&3&lENCHANTED NETHER WART" from player's inventory remove 100000 from {tokens::%player%} close inventory of player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else if index of event-slot is 24: if player has permission "pets.crocodile": send "{@prefix} &fYou already own this pet! (/pets)" to player else: if {tokens::%player%} >= 100000: if player has 32 of shiny wheat named "&3&lENCHANTED WHEAT" in their inventory: if player has 32 of shiny carrot named "&3&lENCHANTED CARROT" in their inventory: if player has 32 of shiny sugar cane named "&3&lENCHANTED SUGAR CANE" in their inventory: if player has 32 of shiny nether wart named "&3&lENCHANTED NETHER WART" in their inventory: if player has 32 of shiny potato named "&3&lENCHANTED POTATO" in their inventory: execute console command "lp user %player% permission set pets.crocodile true" send "&fYou bought the &3&lCROCODILE PET!" to player remove 32 of shiny wheat named "&3&lENCHANTED WHEAT" from player's inventory remove 32 of shiny carrot named "&3&lENCHANTED CARROT" from player's inventory remove 32 of shiny potato named "&3&lENCHANTED POTATO" from player's inventory remove 32 of shiny sugar cane named "&3&lENCHANTED SUGAR CANE" from player's inventory remove 32 of shiny nether wart named "&3&lENCHANTED NETHER WART" from player's inventory remove 100000 from {tokens::%player%} close inventory of player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else: send "{@prefix} &cYou cannot afford this" to player else if index of event-slot is 40: close inventory of player command /pettrader: permission: admin trigger: petsTrader(player) command /farm []: permission: admin trigger: if arg-1 is set: if arg-1 = "wheat": give player 16 of shiny wheat named "&3&lENCHANTED WHEAT" else if arg-1 = "potato": give player 16 of shiny potato named "&3&lENCHANTED POTATO" else if arg-1 = "carrot": give player 16 of shiny carrot named "&3&lENCHANTED CARROT" else if arg-1 = "nether wart": give player 16 of shiny nether wart named "&3&lENCHANTED NETHER WART" else if arg-1 = "sugar cane": give player 16 of shiny sugar cane named "&3&lENCHANTED SUGAR CANE" else if arg-1 is not set: send "/farm (wheat┃carrot┃potato┃nether wart┃sugar cane)" function spawnPet(p: player, id: text, name: text): set {_u} to uuid of {_p} if {_p} and {_id} and {_name} are set: if {ultimatepets::parrots::%{_u}%} is set: kill {ultimatepets::armorstands::%{_u}%} kill {ultimatepets::parrots::%{_u}%} delete {ultimatepets::armorstands::%{_u}%} delete {ultimatepets::parrots::%{_u}%} if {@buffs} is true: resetEffects({_p}, "all") if {_name} is "Hare": apply {@hare} of tier 1 without particles to {_p} for 111111 seconds else if {_name} is "Cheetah": apply {@cheetah} of tier 1 without particles to {_p} for 111111 seconds else if {_name} is "Elephant": apply {@elephant} of tier 1 without particles to {_p} for 111111 seconds else if {_name} is "Crocodile": apply {@crocodile} of tier 1 without particles to {_p} for 111111 seconds send "{@prefix} &aYour %uncolored {_name}%&a was successfully spawned." to {_p} spawn an armor stand at location of {_p} add "{Invisible:1b,Invulnerable:1b,NoBasePlate:1b,NoGravity:1b,Small:1b}" to nbt of spawned armor stand if {_name} is "Elephant" or "Crocodile" or "Cheetah" or "Hare": set helmet of spawned armor stand to skull of {_p} with nbt {_id} set display name of spawned armor stand to "<##FFB448>%uncolored display name of {_p}%'s %uncolored {_name}%" else: set helmet of spawned armor stand to ("%{_name}%" parsed as offline player)'s skull set display name of spawned armor stand to "<##FFB448>%uncolored display name of {_p}%'s Pet" set {ultimatepets::armorstands::%{_u}%} to spawned armor stand spawn a parrot at location of {_p} silence spawned parrot apply invisibility of tier 1 without particles to spawned parrot for 111111 seconds set {ultimatepets::parrots::%{_u}%} to spawned parrot play sound "{@sound}" at volume 0.75 with pitch 1.4 to {_p} while {ultimatepets::parrots::%{_u}%} is alive: if (distance between {ultimatepets::parrots::%{_u}%} and {_p}) is less than 12.5: set path target with speed (distance between {ultimatepets::parrots::%{_u}%} and {_p} / 3) of {ultimatepets::parrots::%{_u}%} to (location 1 above {_p}) else: teleport {ultimatepets::parrots::%{_u}%} to (location of block above {_p}) delete path target of {ultimatepets::parrots::%{_u}%} teleport {ultimatepets::armorstands::%{_u}%} to {ultimatepets::parrots::%{_u}%} add "{Pose:{Head:[%pitch of {ultimatepets::parrots::%{_u}%}%f,0f,0f]}}" to nbt of {ultimatepets::armorstands::%{_u}%} wait 1 tick if {@buffs} is true: resetEffects({_p}, "%{_name}%") else: send "{@prefix} &cAn error occured while spawning your pet." to {_p} function resetEffects(p: player, name: text): if {_name} is "Elephant": remove {@elephant} from {_p} else if {_name} is "Hare": remove {@hare} from {_p} else if {_name} is "Cheetah": remove {@cheetah} from {_p} else if {_name} is "Crocodile": remove {@crocodile} from {_p} else if {_name} is "all": remove {@elephant} from {_p} remove {@crocodile} from {_p} remove {@hare} from {_p} remove {@cheetah} from {_p} on disconnect: resetEffects(player, "all") delete {ultimatepets::choosing::%uuid of player%} function clearPets(): loop all players: resetEffects(loop-player, "all") loop {ultimatepets::parrots::*}: kill loop-value loop {ultimatepets::armorstands::*}: kill loop-value delete {ultimatepets::armorstands::*} delete {ultimatepets::parrots::*} broadcast "{@prefix} &cAll pets have been forcefully cleared." play sound "{@sound}" at volume 0.75 with pitch 0.7 to all players on first join: set {pets::level::hare::%player%} to 0 set {pets::level::cheetah::%player%} to 0 set {pets::level::elephant::%player%} to 0 set {pets::level::crocodile::%player%} to 0 set {pets::xp::hare::%player%} to 0 set {pets::xp::cheetah::%player%} to 0 set {pets::xp::elephant::%player%} to 0 set {pets::xp::crocodile::%player%} to 0 on unload: wait 3 ticks clearPets() on target: if {ultimatepets::parrots::*} or {ultimatepets::armorstands::*} contains event-entity: if target is not a player: cancel event on right click on armor stand or parrot: if {ultimatepets::armorstands::*} contains event-entity: cancel event else if {ultimatepets::parrots::*} contains event-entity: cancel event on damage of parrot or armor stand: if {ultimatepets::parrots::*} contains victim: cancel event else if {ultimatepets::parrots::*} contains victim: cancel event on death: if {ultimatepets::parrots::*} contains the victim: cancel the drops on disconnect: kill {ultimatepets::parrots::%uuid of player%} kill {ultimatepets::armorstands::%uuid of player%} delete {ultimatepets::armorstands::%uuid of player%} delete {ultimatepets::parrots::%uuid of player%}