Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # _ ____ _
- # ___ | | __ | _ \ ___ | |_ ___
- # / __| | |/ / | |_) | / _ \ | __| / __|
- # \__ \ | < | __/ | __/ | |_ \__ \
- # |___/ |_|\_\ |_| \___| \__| |___/
- #
- #Author: YoshYz
- #Version: 1.2.1c
- #==========================================================================================================#
- # -------------------------------------------------------------------------------------------------------- #
- # OPTIONS #
- # -------------------------------------------------------------------------------------------------------- #
- #==========================================================================================================#
- options:
- #Main Things:
- Prefix: &9▪ skPets&9>
- NoPermissions: &cYou don't have the permission to execute this command.
- #Options:
- LoadingPanel: true #false
- #Messages:
- newPet_created: &7You have created the &a[pet] &7pet.
- newPet_alreadyExist: &7The &a[pet] &7pet already exist.
- deletePet_deleted: &7You have deleted the &c[pet] &7pet.
- findPet_doesntExist: &7The &c[pet] &7pet doesn't exist in the database.
- spawnPet_spawned: &7Your pet is now spawned.
- myPet_withoutPet: &7You don't have a pet.
- myPet_notwithYou: &7Your pet isn't with you.
- callPet: &7Your pet has just reached you!
- despawnPet: &7Your pet is now despawned.
- hatPet_enable: &7Your pet jumped on you.
- hatPet_disable: &7Your pet dropped from you.
- myPet_hungry: &7Your pet is hungry , you need to feed him.
- wrong_sintax: &cWrong syntax of the command&8: &c/pets help
- #Panels:
- #> LoadingPanel:
- loadingPanel_title: &9Loading...
- #> PetsShop:
- petsShop_title: &9skPets - Selector
- petsShop_petUnlocked: &8[&a[pet]&8]
- petsShop_petLocked: &8[&c[pet]&8]
- #> PetsProfile:
- petsProfile_title: &9skPets - Profile
- #==========================================================================================================#
- # -------------------------------------------------------------------------------------------------------- #
- # FUNCTIONS #
- # -------------------------------------------------------------------------------------------------------- #
- #==========================================================================================================#
- function loadingPanel(p: player):
- open virtual chest inventory with size 5 named "{@loadingPanel_title}" to {_p}
- loop 3 times:
- make a gui slot 23 of {_p} with Air named " " to do nothing
- make a gui slot 21 of {_p} with Light Green Stained Glass Pane named " " to do nothing
- wait 2 ticks
- make a gui slot 21 of {_p} with Air named " " to do nothing
- make a gui slot 22 of {_p} with Light Green Stained Glass Pane named " " to do nothing
- wait 2 ticks
- make a gui slot 22 of {_p} with Air named " " to do nothing
- make a gui slot 23 of {_p} with Light Green Stained Glass Pane named " " to do nothing
- wait 2 ticks
- make a gui slot 21 of {_p} with Air named " " to do nothing
- make a gui slot 22 of {_p} with Air named " " to do nothing
- make a gui slot 23 of {_p} with Air named " " to do nothing
- function progressPet(player: player) :: text:
- set {_uuid} to "%uuid of {_player}%"
- set {_progress} to ""
- loop 8 times:
- if loop-value > ({skpets::players::%{_uuid}%::pet::exp} / {skpets::players::%{_uuid}%::pet::expneeded} * 8):
- set {_progress} to "%{_progress}%&8■"
- else:
- set {_progress} to "%{_progress}%■"
- set {_medium} to {skpets::players::%{_uuid}%::pet::expneeded}/2
- set {_low} to {skpets::players::%{_uuid}%::pet::expneeded}/3
- if {skpets::players::%{_uuid}%::pet::exp} >= {skpets::players::%{_uuid}%::pet::expneeded}:
- set {_progress} to "&2%{_progress}%"
- if {skpets::players::%{_uuid}%::pet::exp} >= {_medium}:
- if {skpets::players::%{_uuid}%::pet::exp} < {skpets::players::%{_uuid}%::pet::expneeded}:
- set {_progress} to "&a%{_progress}%"
- if {skpets::players::%{_uuid}%::pet::exp} <= {_medium}:
- if {skpets::players::%{_uuid}%::pet::exp} > {_low}:
- set {_progress} to "&6%{_progress}%"
- if {skpets::players::%{_uuid}%::pet::exp} <= {_low}:
- set {_progress} to "&c%{_progress}%"
- return {_progress}
- function levelUpPet(player: player):
- set {_uuid} to "%uuid of {_player}%"
- if {skpets::players::%{_uuid}%::pet::exp} >= {skpets::players::%{_uuid}%::pet::expneeded}:
- add 1 to {skpets::players::%{_uuid}%::pet::level}
- remove {skpets::players::%{_uuid}%::pet::expneeded} from {skpets::players::%{_uuid}%::pet::exp}
- set {skpets::players::%{_uuid}%::pet::exp} to {skpets::players::%{_uuid}%::pet::exp}
- set {skpets::players::%{_uuid}%::pet::progress} to 0
- set {skpets::players::%{_uuid}%::pet::expneeded} to {skpets::players::%{_uuid}%::pet::expneeded}*2
- function forcedespawnPet(player: player):
- set {_uuid} to "%uuid of {_player}%"
- if {skpets::players::%{_uuid}%::pet::type} is set:
- if {skpets::players::%{_uuid}%::pet::entity} is set:
- teleport {skpets::players::%{_uuid}%::pet::entity} to location at 99999 , 200 , 99999 in world "world"
- kill {skpets::players::%{_uuid}%::pet::entity}
- delete {skpets::players::%{_uuid}%::pet::entity}
- stop
- function despawnALLPets():
- loop all entities:
- if loop-entity is a zombie:
- if "%nbt of loop-entity%" contains "Silent:1":
- teleport loop-entity to location at 99999 , 200 , 99999 in world "world"
- kill loop-entity
- if loop-entity is a player:
- delete {skpets::players::%uuid of loop-entity%::pet::entity}
- function despawnPet(player: player) :: boolean:
- set {_uuid} to "%uuid of {_player}%"
- if {skpets::players::%{_uuid}%::pet::type} is set:
- if {skpets::players::%{_uuid}%::pet::entity} is set:
- teleport {skpets::players::%{_uuid}%::pet::entity} to location at 99999 , 200 , 99999 in world "world"
- kill {skpets::players::%{_uuid}%::pet::entity}
- delete {skpets::players::%{_uuid}%::pet::entity}
- set {_status} to true
- return {_status}
- stop
- set {_status} to false
- return {_status}
- function oorangePet(player: player):
- set {_uuid} to "%uuid of {_player}%"
- if {skpets::players::%{_uuid}%::pet::type} is set:
- if {skpets::players::%{_uuid}%::pet::entity} is set:
- while {skpets::players::%{_uuid}%::pet::entity} is alive:
- if distance between {skpets::players::%{_uuid}%::pet::entity} and {_player} >= 15:
- forcedespawnPet( {_player} )
- message " {@Prefix} {@despawnPet}" to {_player}
- stop
- wait 5 seconds
- chance of 25%:
- if {skpets::players::%{_uuid}%::pet::hunger} > 0:
- remove 1 from {skpets::players::%{_uuid}%::pet::hunger}
- stop
- function newPet(name: text , texture: integer) :: boolean:
- if {skpets::list::%{_name}%} is set:
- set {_status} to false
- return {_status}
- stop
- set {skpets::list::%{_name}%} to "%{_name}%"
- if {_texture} is 1: #VOLTORB
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""9aa4abee-bee6-4770-811d-f8b02fa30b43"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTJmM2Y5Y2NhNzdjNzI1MjE3ZTQ1YWQ0ZWVlZWZmYTA1NjVmODJiODY2YWM2Nzk5OWI0M2MzYTk3MzExNjI4YyJ9fX0=""}]}}}"
- if {_texture} is 2: #FROG
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""ce649e79-9da2-49b3-8e72-6614b7abf17c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTdlYmNlZjQ2ODNjZGI3MTYzZTk2OWU0ZTIyNjlmMzY3M2E1ZDVlNmI3OGUwNmZhZWU0NWJjZjdjNDljMzk3In19fQ==""}]}}}"
- if {_texture} is 3: #GOLDEN CHICKEN
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""0298fc50-d90e-4f59-8978-227e490784a8"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmM0MjUyZTMyMzI5ODUzNTM5ZjhmMWVmMWQwNTAyZGFlY2JhZTdiZTVkMzNiODU3ZjQzZTFjMjg0Y2ViNWEifX19""}]}}}"
- if {_texture} is 4: #PIDGEOT
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""a20bdb44-c996-46a1-86f2-4ab799708f32"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjZjOTZhZWY2NTU4ZjI5YjI0N2JjOGUzOGQ5MzIwNjE0M2YxMzE0NDc1YzVmY2QxMWUyZWZjYzVkYjU1ZTg1In19fQ==""}]}}}"
- if {_texture} is 5: #MAGIKARP
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""41dac880-eb6f-422e-9dc0-f7dec0e12933"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmY1OGZiN2NiZjlmOGRjZmMzYmM5ZDYxYzdjYjViMjI5YmY0OWRiMTEwMTMzNmZmZGMyZDA4N2MwYjk0MTYyIn19fQ==""}]}}}"
- if {_texture} is 6: #OWL
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""42f3cb1a-519c-48ba-84e7-2981c909672a"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWRiZDhiNmNiM2IxZWNkOWNhMzU5YjgzM2MxYmVmMjJlOTczMmZiN2FhMGQwZmY0ZmI1NTg4ODZmNWE2YSJ9fX0=""}]}}}"
- if {_texture} is 7: #WHITE TURKEY
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""13453078-0126-45a2-b76f-da8b92731f9e"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWJkM2VlZThmOWU5NGUzMDhjYzNjNjFkN2IzMzBmZWQ1ZGE4MzVjNjRhYWFhYzZhM2QyYTVkMTZkNDlmNDgifX19""}]}}}"
- if {_texture} is 8: #BLACK TURKEY
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""976303b8-8d2d-4f9f-8aff-9395950f2178"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGMxNjJkOTY5ODQ0ZDcyMzEyOTZjZmVhNThmZGRjNGFmZTRiNGYyY2ZhMTFiODg3ZmU3YjAzZWQ4ZSJ9fX0=""}]}}}"
- if {_texture} is 9: #BEE
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""bc1ca880-4dc5-4d17-9c05-027a7d3999b3"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTQ3MzIyZjgzMWUzYzE2OGNmYmQzZTI4ZmU5MjUxNDRiMjYxZTc5ZWIzOWM3NzEzNDlmYWM1NWE4MTI2NDczIn19fQ==""}]}}}"
- if {_texture} is 10: #TURTLE
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""ef56c7a3-a5e7-4a7f-9786-a4b6273a591d"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTJlNTQ4NDA4YWI3NWQ3ZGY4ZTZkNWQyNDQ2ZDkwYjZlYzYyYWE0ZjdmZWI3OTMwZDFlZTcxZWVmZGRmNjE4OSJ9fX0=""}]}}}"
- if {_texture} is 11: #ALIEN
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""24b35510-4cfd-4b24-b19d-d41727aff5f3"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmViMjMxOWEzZDg4NDMxOGQ4MjkxMmI2OTEwMjZkZjZlNjYzNmMyZTI0MWQ0OWM1YTY5ZGI4MzBhYTdmNTEifX19""}]}}}"
- if {_texture} is 12: #BB-8
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""837e8ce1-1850-4087-a51e-72720b19d7d9"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzg1Njk4MWNjZWM4YTQ5Mjg5OGUwY2I0ZDk0NDNkMjE0NTlkNWI2NWRmYThkYTQ2MmQxNzY5N2ExNzhmOGUifX19""}]}}}"
- if {_texture} is 13: #BROWN DOG
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""007f45cd-8b89-4198-a484-358a7fd943e8"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmVjMDUyYmU3NmUzOTE0OGEyN2YyNTVlYzUzN2RmZjkyMDE4Yzc5NzQ0MjAyZDYwYzUxYmM2N2Q2MThhZTM2YSJ9fX0=""}]}}}"
- if {_texture} is 14: #JACK LANTERN
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""3208edcf-3a19-46ab-9d9b-e2077ba088c0"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTMyMTVhZDJiNTYwNzgxM2YwODExZTZmMTkzZTdmNzExYWQ5NTE2NGM0NWI3ZGM1ZTViYWRmNDU4M2I2OTQifX19""}]}}}"
- if {_texture} is 15: #PUG DOG
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""e637de03-8a6b-492f-ac45-1afd3feaf31d"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTZlOTY3NTYzMWVhZDI1Yzc4MmI1NmExMzM4MjdiN2JjZTRhNTJmNDVkMTg0OTJlZjE4ZWY5ZGJhMzI0YzVkIn19fQ==""}]}}}"
- if {_texture} is 16: #CYAN SLIME
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""d3b9225c-a6d0-4f61-b022-a48c98f2042c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTVhYTc4OTU4MzBmNTY2NjE4YTcxYWY2OTExMjQ2NTRhYmMxY2RmYzE4YmJkNmE2NjMxZGZiZGM2YTY0OGIyIn19fQ==""}]}}}"
- if {_texture} is 17: #BLUE SLIME
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""656db066-d2c1-4c8d-8591-c633d0892369"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzZmMjg2MDM5YmRkNDBjZmM5NmE1YzU5N2Y5ZjRiZGVkNDMzOWVjOTU3MzJkYTY1NTE5NzJlMGYxZDU3MyJ9fX0=""}]}}}"
- if {_texture} is 18: #PINK SLIME
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""36aeb989-42d5-4a66-a8b0-788e637cf3b6"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNThiMTdiMzQ4ZWJlNzM5OTYzOGIwNDUzMjVmZTQ3NDdmMjEzZmJkNzEyN2ZjMzM3NDZjZTkyNDA2NjMyNmMifX19""}]}}}"
- if {_texture} is 19: #RED SLIME
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""f2cb7f86-d752-496e-bf24-92900a9afc0d"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDE3MTU3ZjNkYzNlMWE1OTJiNDNiNGVmN2UxNjg3OTRlYzYyNzEzOGExMDY1MzcyM2FkMzJjOGQxNjAyNiJ9fX0=""}]}}}"
- if {_texture} is 20: #YELLOW SLIME
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""9e621490-a9c2-4ff5-983b-ab5a9a93b17a"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDRmMmE5ZWNlOGEyNDQ2NmU2NDU1NmZlZjQyNjdiNTlkYjQ5MWE0Y2NiNmE1NmUwNGQzOGVhNWI1MzU0MmRjIn19fQ==""}]}}}"
- if {_texture} is 21: #KIRYU
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""17001653-ef1c-409e-ac5f-ee5519c82d39"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2FhZWM0OGZhZmJmZTViOTc3YjNmYWE0OTE2ZDZhYTMwYmViNjkxYzUxMTc0ZDVlY2ExMTc0YmMyNWJiYjgxIn19fQ==""}]}}}"
- if {_texture} is 22: #RED DRAGON
- set {skpets::pets::%{_name}%::texture} to "{display:{Name:""%{_name}%""},SkullOwner:{Id:""22bde0b3-d29a-49cd-a5a0-04cf4f107173"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzgzYWI0MmYyMmFkZDkzNjZkODkzNjRiYTNhZTIwMTNmYTQ1YTQ1NWNkODdjYTZhYWQ4MmY0MDFhNzcifX19""}]}}}"
- set {_status} to true
- return {_status}
- function deletePet(name: text) :: boolean:
- if {skpets::list::%{_name}%} is set:
- set {_status} to true
- clear {skpets::list::%{_name}%}
- delete {skpets::list::%{_name}%}
- clear {skpets::pets::%{_name}%::*}
- loop all zombies:
- set {_nbt} to "%nbt of loop-entity%"
- if {_nbt} contains "%{_name}%":
- teleport loop-entity to location at 99999 , 200 , 99999 in world "world"
- kill loop-entity
- loop all players:
- if {skpets::players::%uuid of loop-player%::pet::type} is "%{_name}%":
- clear {skpets::players::%uuid of loop-player%::pet::*}
- return {_status}
- stop
- set {_status} to false
- return {_status}
- function setPet(player: player , name: text) :: boolean:
- close {_player}'s inventory
- set {_uuid} to "%uuid of {_player}%"
- if {skpets::list::%{_name}%} is set:
- if {skpets::players::%{_uuid}%::pet::entity} is set:
- forcedespawnPet( {_player} )
- set {skpets::players::%{_uuid}%::pet::type} to "%{_name}%"
- set {skpets::players::%{_uuid}%::pet::hunger} to 100
- set {skpets::players::%{_uuid}%::pet::name} to "&a%{_player}%&b's pet &7LvL-&b1"
- set {skpets::players::%{_uuid}%::pet::level} to 1
- set {skpets::players::%{_uuid}%::pet::exp} to 0
- set {skpets::players::%{_uuid}%::pet::expneeded} to 25
- set {skpets::players::%{_uuid}%::pet::progress} to 0
- set {_status} to true
- return {_status}
- stop
- set {_status} to false
- return {_status}
- function fixPet(player: player):
- set {_uuid} to "%uuid of {_player}%"
- set {skpets::players::%{_uuid}%::pet::entity}'s chestplate to iron chestplate
- set {skpets::players::%{_uuid}%::pet::entity}'s leggings to iron leggings
- set {skpets::players::%{_uuid}%::pet::entity}'s boots to iron boots
- set {skpets::players::%{_uuid}%::pet::entity}'s held item to iron sword
- wait 1 ticks
- set {skpets::players::%{_uuid}%::pet::entity}'s chestplate to air
- set {skpets::players::%{_uuid}%::pet::entity}'s leggings to air
- set {skpets::players::%{_uuid}%::pet::entity}'s boots to air
- set {skpets::players::%{_uuid}%::pet::entity}'s held item to air
- function spawnPet(player: player) :: boolean:
- set {_uuid} to "%uuid of {_player}%"
- if {skpets::players::%{_uuid}%::pet::type} is set:
- if {skpets::players::%{_uuid}%::pet::entity} is set:
- forcedespawnPet( {_player} )
- spawn 1 zombie at location 99999 , 200 , 99999 in world "world"
- add "{CanPickUpLoot:0,Equipment:[{id:""air"",damage:0},{id:""air"",damage:0},{id:""air"",damage:0},{id:""air"",damage:0},{id:""air"",damage:0}],Silent:1,NoAI:0,ActiveEffects:[{Id:14,Amplifier:2,Duration:999999,ShowParticles:0b}],Attributes:[{Name:generic.attackDamage,Base:0},{Name:generic.followRange,Base:30},{Name:generic.movementSpeed,Base:0.3}]}" to nbt of last spawned zombie
- set the helmet of last spawned zombie to skull of player with nbt "%{skpets::pets::%{skpets::players::%{_uuid}%::pet::type}%::texture}%"
- set {_skpets::players::%{_uuid}%::pet::entity} to last spawned zombie
- set {skpets::players::%{_uuid}%::pet::entity} to {_skpets::players::%{_uuid}%::pet::entity}
- fixPet( {_player} )
- teleport {skpets::players::%{_uuid}%::pet::entity} to location of {_player}
- set {_status} to true
- return {_status}
- stop
- set {_status} to false
- return {_status}
- function callPet(player: player) :: boolean:
- set {_uuid} to "%uuid of {_player}%"
- if {skpets::players::%{_uuid}%::pet::type} is set:
- forcedespawnPet( {_player} )
- spawnPet( {_player} )
- set {_status} to true
- return {_status}
- stop
- set {_status} to false
- return {_status}
- function ridePet(player: player) :: boolean:
- set {_uuid} to "%uuid of {_player}%"
- force {_player} dismount
- if {skpets::players::%{_uuid}%::pet::type} is set:
- if {skpets::players::%{_uuid}%::pet::entity} is set:
- if {skpets::players::%{_uuid}%::pet::hunger} > 20:
- close {_player}'s inventory
- teleport {skpets::players::%{_uuid}%::pet::entity} to location of {_player}
- make {_player} ride {skpets::players::%{_uuid}%::pet::entity}
- set {_status} to true
- loop integers from 2 to 6:
- set {_slot::%loop-int%} to {_player}'s slot loop-int
- set slot 2 of {_player}'s inventory to skull of player with nbt "{display:{Name:""Oak Wood Arrow Left""},SkullOwner:{Id:""2391d533-ab09-434d-9980-adafde4057a3"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmQ2OWUwNmU1ZGFkZmQ4NGU1ZjNkMWMyMTA2M2YyNTUzYjJmYTk0NWVlMWQ0ZDcxNTJmZGM1NDI1YmMxMmE5In19fQ==""}]}}}" named "&bLeft"
- set slot 3 of {_player}'s inventory to skull of player with nbt "{display:{Name:""Oak Wood Arrow Down""},SkullOwner:{Id:""5ca62fac-d094-4346-8361-e1dfdd970607"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzQzNzM0NmQ4YmRhNzhkNTI1ZDE5ZjU0MGE5NWU0ZTc5ZGFlZGE3OTVjYmM1YTEzMjU2MjM2MzEyY2YifX19""}]}}}" named "&bBackwards"
- set slot 4 of {_player}'s inventory to skull of player with nbt "{display:{Name:""Oak Wood Dot""},SkullOwner:{Id:""b4f2fdc2-aa8e-44d7-ab8d-f409cae70b50"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzQ1NjQ4NWFhMjM2MTQzNGNiM2JlNTMxYmMxMjE2NTlmNTU1YTRhYWYyNjFkMjFhMDZkN2FmZGU1YWE2MGIyIn19fQ==""}]}}}" named "&bJump"
- set slot 5 of {_player}'s inventory to skull of player with nbt "{display:{Name:""Oak Wood Arrow Up""},SkullOwner:{Id:""36ecf9de-9ce4-4ee3-a5af-c8beb82b9cc3"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzA0MGZlODM2YTZjMmZiZDJjN2E5YzhlYzZiZTUxNzRmZGRmMWFjMjBmNTVlMzY2MTU2ZmE1ZjcxMmUxMCJ9fX0=""}]}}}" named "&bForwards"
- set slot 6 of {_player}'s inventory to skull of player with nbt "{display:{Name:""Oak Wood Arrow Right""},SkullOwner:{Id:""d513d666-0992-42c7-9aa6-e518a83e0b38"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTliZjMyOTJlMTI2YTEwNWI1NGViYTcxM2FhMWIxNTJkNTQxYTFkODkzODgyOWM1NjM2NGQxNzhlZDIyYmYifX19""}]}}}" named "&bRight"
- while {_player}'s vehicle is set:
- if name of {_player}'s held item is "&bJump":
- push {_player}'s vehicle upwards at speed 0.4
- wait 5 ticks
- push {_player}'s vehicle forwards at speed 0.2
- wait 2 ticks
- push {_player}'s vehicle downwards at speed 0.4
- if name of {_player}'s held item is "&bLeft":
- push {_player}'s vehicle left at speed 0.4
- if name of {_player}'s held item is "&bRight":
- push {_player}'s vehicle right at speed 0.4
- if name of {_player}'s held item is "&bForwards":
- push {_player}'s vehicle forwards at speed 0.4
- if name of {_player}'s held item is "&bBackwards":
- push {_player}'s vehicle backwards at speed 0.4
- wait 4 ticks
- loop integers from 2 to 6:
- set slot loop-int of {_player}'s inventory to air
- set slot loop-int of {_player}'s inventory to {_slot::%loop-int%}
- else:
- set {_status} to false
- return {_status}
- stop
- else:
- set {_status} to false
- return {_status}
- stop
- else:
- set {_status} to false
- return {_status}
- stop
- function toggleHatPet(player: player) :: boolean:
- set {_uuid} to "%uuid of {_player}%"
- if {skpets::players::%{_uuid}%::pet::type} is set:
- if {skpets::players::%{_uuid}%::pet::entity} is set:
- if {skpets::players::%{_uuid}%::pet::hunger} > 20:
- close {_player}'s inventory
- if {skpets::players::%{_uuid}%::pet::entity} is riding {_player}:
- make {skpets::players::%{_uuid}%::pet::entity} dismount
- teleport {skpets::players::%{_uuid}%::pet::entity} to location of {_player}
- message " {@Prefix} {@hatPet_disable}" to {_player}
- else:
- teleport {skpets::players::%{_uuid}%::pet::entity} to location of {_player}
- make {skpets::players::%{_uuid}%::pet::entity} ride {_player}
- message " {@Prefix} {@hatPet_enable}" to {_player}
- set {_status} to true
- return {_status}
- stop
- set {_status} to false
- return {_status}
- stop
- #==========================================================================================================#
- # -------------------------------------------------------------------------------------------------------- #
- # GLOBAL DESPAWNING #
- # -------------------------------------------------------------------------------------------------------- #
- #==========================================================================================================#
- on skript start:
- despawnALLPets()
- on skript load:
- despawnALLPets()
- on skript stop:
- despawnALLPets()
- #==========================================================================================================#
- # -------------------------------------------------------------------------------------------------------- #
- # COMMANDS #
- # -------------------------------------------------------------------------------------------------------- #
- #==========================================================================================================#
- command /pets [<text>] [<text>] [<integer>]:
- aliases: /pet, /skpet or /skpets
- trigger:
- if argument-1 isn't set:
- if {skpets::players::%uuid of player%::pet::type} is set:
- make player execute command "/pets profile"
- stop
- else:
- make player execute command "/pets shop"
- stop
- if argument-1 is "create":
- if player has permission "skpets.create":
- if argument-2 is set:
- if argument-3 is set:
- set {_value} to "%arg-3%" parsed as integer
- set {_status} to newPet( "%arg-2%" , {_value} )
- set {_message-1} to "{@newPet_created}"
- set {_message-2} to "{@newPet_alreadyExist}"
- replace all "[pet]" with "%arg-2%" in {_message-1}
- replace all "[pet]" with "%arg-2%" in {_message-2}
- if {_status} is true:
- message " {@Prefix} %{_message-1}%"
- stop
- if {_status} is false:
- message " {@Prefix} %{_message-2}%"
- stop
- else:
- message "{@Prefix} {@wrong_sintax}"
- stop
- else:
- message "{@Prefix} {@wrong_sintax}"
- stop
- else:
- message "{@Prefix} {@NoPermissions}"
- stop
- if argument-1 is "delete":
- if player has permission "skpets.delete":
- if argument-2 is set:
- set {_status} to deletePet( "%arg-2%" )
- set {_message-1} to "{@deletePet_deleted}"
- set {_message-2} to "{@findPet_doesntExist}"
- replace all "[pet]" with "%arg-2%" in {_message-1}
- replace all "[pet]" with "%arg-2%" in {_message-2}
- if {_status} is true:
- message " {@Prefix} %{_message-1}%"
- stop
- if {_status} is false:
- message " {@Prefix} %{_message-2}%"
- stop
- else:
- message "{@Prefix} {@wrong_sintax}"
- stop
- else:
- message "{@Prefix} {@NoPermissions}"
- stop
- if argument-1 is "set":
- if argument-2 is set:
- if player has permission "skpets.pets.%arg-2%":
- set {_status} to setPet( player , "%arg-2%" )
- set {_message-1} to "{@findPet_doesntExist}"
- replace all "[pet]" with "%arg-2%" in {_message-1}
- if {_status} is true:
- set {_status} to spawnPet( player )
- if {_status} is true:
- set {_message-1} to "{@spawnPet_spawned}"
- oorangePet(player)
- message " {@Prefix} %{_message-1}%"
- stop
- if {_status} is false:
- message " {@Prefix} %{_message-1}%"
- stop
- else:
- message "{@Prefix} {@NoPermissions}"
- stop
- else:
- message "{@Prefix} {@wrong_sintax}"
- stop
- if argument-1 is "menu" or "profile":
- if player has permission "skpets.menu" or "skpets.profile":
- if {@LoadingPanel} is true:
- loadingPanel( player )
- wait 1 second
- open virtual chest inventory with size 6 named "{@petsProfile_title}" to the player
- loop 54 times:
- make a gui slot loop-number -1 of player with Gray Stained Glass Pane named " " to do nothing
- set {_progress} to progressPet( player )
- make a gui slot 22 of player with player's skull with nbt "%{skpets::pets::%{skpets::players::%uuid of player%::pet::type}%::texture}%" named "&8-[&aMy pet&8]-" with lore "|| &3Informations&8:|||| &9▪ &7Hunger&8: &8[&b%{skpets::players::%uuid of player%::pet::hunger}%&7/&3100&8]|| &9▪ &7Level&8: &e%{skpets::players::%uuid of player%::pet::level}%|| &9▪ &7Progress&8: &8[&b%{skpets::players::%uuid of player%::pet::exp}%&7/&3%{skpets::players::%uuid of player%::pet::expneeded}%&8]|||| %{_progress}%||&d" to do nothing
- make a gui slot 37 of player with Lead named "&aCall" with lore "|| &9» &7Rightclick to call your pet.||&d" to run player command "/pet call"
- make a gui slot 38 of player with player's skull with nbt "{display:{Name:""Blue Chalice""},SkullOwner:{Id:""df3308c5-b324-4eab-952e-309ef2008f92"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzRlYWY5NmMzYzBiMWYwZTQ2OGFmM2RkOWEyODk2MzI3N2ZhNDQ4Njc2YjE0YzVlODk0NTA4NTNjZDUzIn19fQ==""}]}}}" named "&aDespawn" with lore "|| &9» &7Rightclick to despawn your pet.||&d" to run player command "/pet back"
- make a gui slot 42 of player with Saddle named "&aRide" with lore "|| &9» &7Rightclick to ride your pet.||&d" to run player command "/pet ride"
- make a gui slot 43 of player with player's skull with nbt "{display:{Name:""Top Hat""},SkullOwner:{Id:""819376bc-d037-4816-8fa4-a55b3bc36ef4"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTIyYWY2N2M1YjFlMjUyZjgzYjM2NWIzOWE2YjU4OTVkMTU3NGRhYWIyZDU3NDg0MjIzY2Y0ZTE1OWM2N2UifX19""}]}}}" named "&aHat" with lore "|| &9» &7Rightclick to toggle your hat.||&d" to run player command "/pet hat"
- if argument-1 is "shop" or "selector":
- if player has permission "skpets.shop":
- if {@LoadingPanel} is true:
- loadingPanel( player )
- wait 1 second
- open virtual chest inventory with size 6 named "{@petsShop_title}" to the player
- loop 54 times:
- make a gui slot loop-number -1 of player with Gray Stained Glass Pane named " " to do nothing
- set {_slot} to 10
- loop {skpets::list::*}:
- add 1 to {_pets}
- set {_unlocked} to "{@petsShop_petUnlocked}"
- set {_locked} to "{@petsShop_petLocked}"
- replace all "[pet]" with "%loop-value%" in {_unlocked}
- replace all "[pet]" with "%loop-value%" in {_locked}
- if player has permission "skpets.pets.%loop-value%":
- make a gui slot {_slot} of player with player's skull with nbt "%{skpets::pets::%loop-value%::texture}%" named "%{_unlocked}%" with lore "|| &3Informations&8:|||| &9▪ &7Type&8: &b%loop-value%|| &9▪ &7Status&8: &aUnlocked|||| &9» &aRightclick to select." to run player command "/pets set %loop-value%"
- else if player doesn't have permission "skpets.pets.%loop-value%":
- make a gui slot {_slot} of player with player's skull with nbt "%{skpets::pets::%loop-value%::texture}%" named "%{_locked}%" with lore "|| &3Informations&8:|||| &9▪ &7Type&8: &b%loop-value%|| &9▪ &7Status&8: &cLocked|||| &9» &cYou don't own this pet." to do nothing
- if {_slot} is 16,25 or 34:
- add 3 to {_slot}
- else:
- add 1 to {_slot}
- if {_pets} >= 28:
- stop loop
- else:
- message "{@Prefix} {@NoPermissions}"
- stop
- if argument-1 is "call":
- if player has permission "skpets.call":
- set {_status} to callPet( player )
- set {_message-1} to "{@callPet}"
- if {_status} is true:
- message " {@Prefix} %{_message-1}%"
- oorangePet(player)
- stop
- if {_status} is false:
- message " {@Prefix} {@myPet_withoutPet}"
- stop
- else:
- message "{@Prefix} {@NoPermissions}"
- stop
- if argument-1 is "ride":
- if player has permission "skpets.ride":
- set {_status} to ridePet( player )
- if {_status} is false:
- if {skpets::players::%uuid of player%::pet::type} is set:
- if {skpets::players::%uuid of player%::pet::hunger} > 20:
- message " {@Prefix} {@myPet_notwithYou}"
- stop
- else:
- message " {@Prefix} {@myPet_hungry}"
- stop
- else:
- message " {@Prefix} {@myPet_withoutPet}"
- stop
- else:
- message "{@Prefix} {@NoPermissions}"
- stop
- if argument-1 is "hat":
- if player has permission "skpets.hat":
- set {_status} to toggleHatPet( player )
- if {_status} is false:
- if {skpets::players::%uuid of player%::pet::type} is set:
- if {skpets::players::%uuid of player%::pet::hunger} > 20:
- message " {@Prefix} {@myPet_notwithYou}"
- stop
- else:
- message " {@Prefix} {@myPet_hungry}"
- stop
- else:
- message " {@Prefix} {@myPet_withoutPet}"
- stop
- else:
- message "{@Prefix} {@NoPermissions}"
- stop
- if argument-1 is "despawn" or "back":
- if player has permission "skpets.despawn":
- set {_status} to despawnPet( player )
- if {_status} is true:
- message " {@Prefix} {@despawnPet}"
- stop
- if {_status} is false:
- if {skpets::players::%uuid of player%::pet::type} is set:
- message " {@Prefix} {@myPet_notwithYou}"
- stop
- else:
- message " {@Prefix} {@myPet_withoutPet}"
- stop
- else:
- message "{@Prefix} {@NoPermissions}"
- stop
- if argument-1 is "author", "version", "ver" or "info":
- message " {@Prefix} &aYoshYz Version&8: &7v1.2.1c"
- stop
- if argument-1 is "help":
- if player has permission "skpets.help":
- message "&f&l&m---------------------------------------"
- message "&a&l SKPETS"
- message " &9▪ /pets help"
- message " &9▪ /pets ver"
- message " &9▪ /pets profile"
- message " &9▪ /pets shop"
- message " &9▪ /pets create [<name>] [<ID>]"
- message " &9▪ /pets delete [<name>]"
- message "&f&l&m---------------------------------------"
- stop
- else:
- message " {@Prefix} {@NoPermissions}"
- stop
- #==========================================================================================================#
- # -------------------------------------------------------------------------------------------------------- #
- # FEED PET #
- # -------------------------------------------------------------------------------------------------------- #
- #==========================================================================================================#
- on rightclick on zombie:
- if {skpets::players::%uuid of player%::pet::type} is set:
- if {skpets::players::%uuid of player%::pet::entity} is set:
- if {skpets::players::%uuid of player%::pet::entity} is clicked entity:
- if player is holding apple, bread, melon, cookie, carrot, potato, baked potato or cooked fish:
- if {skpets::players::%uuid of player%::pet::hunger} < 100:
- remove 1 of player's held item from player's inventory
- set {_x} to a random integer between 2 and 5
- loop {_x} times:
- if {skpets::players::%uuid of player%::pet::hunger} < 100:
- add 1 to {skpets::players::%uuid of player%::pet::hunger}
- add 1 to {skpets::players::%uuid of player%::pet::exp}
- set {_pos} to a random integer between 2 and 3
- show heart at the location {_pos} blocks upwards clicked entity
- wait 3 ticks
- levelUpPet( player )
- stop
- else:
- set {_x} to a random integer between 2 and 3
- loop {_x} times:
- set {_pos} to a random integer between 2 and 3
- show angry villager at the location {_pos} blocks upwards clicked entity
- wait 3 ticks
- stop
- else:
- set {_x} to a random integer between 2 and 3
- loop {_x} times:
- set {_pos} to a random integer between 2 and 3
- show angry villager at the location {_pos} blocks upwards clicked entity
- wait 3 ticks
- stop
- #==========================================================================================================#
- # -------------------------------------------------------------------------------------------------------- #
- # SMALL EVENTS #
- # -------------------------------------------------------------------------------------------------------- #
- #==========================================================================================================#
- #Ride debugs
- on inventory open:
- if player is riding:
- make the player dismount
- on join:
- remove all heads from player's inventory
- if player is riding:
- make the player dismount
- on disconnect:
- remove all heads from player's inventory
- if player is riding:
- make the player dismount
- on command:
- if player is riding:
- make the player dismount
- on place:
- if player is riding:
- cancel the event
- #Despawn
- on quit:
- forcedespawnPet( player )
- #Death drop FIX
- on death of zombie:
- if "%nbt of event-entity%" contains "Silent:1":
- remove all dropped items from drops
- remove all rotten flesh from drops
- remove all heads from drops
- #Damage
- on damage:
- if "%nbt of victim%" contains "Silent:1":
- cancel the event
- if attacker is a zombie:
- if "%nbt of attacker%" contains "Silent:1":
- cancel the event
Advertisement
Add Comment
Please, Sign In to add comment