Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on rightclick:
- if player's tool is {ChickenPet}, {CowPet} or {TigerPet} or {TurtlePet} or {GuardianPet} or {SharkPet} or {VillagerPet} or {BirdPet} or {EndermanPet} or {TimePet}:
- if difference between {PetSpawnCooldown::%UUID of player%} and now is less than 3 seconds:
- play sound "block.note_block.bass" with pitch 2 to player
- send "&9&lPETS: &7There is a &e3 seconds &7cooldown on using pets!" to event-player
- stop
- set {PetSpawnCooldown::%UUID of player%} to now
- if {SpawnedPet::%UUID of player%} is not set:
- if player's z-coord is between 121 and 96:
- if player's x-coord is between 121 and 96:
- play sound "entity.chicken.egg" with pitch 1 to player
- play sound "entity.ender_dragon.flap" with pitch 2 to player
- play sound "entity.experience_orb.pickup" with pitch 2 to player
- if player's tool is {ChickenPet}:
- send "&9&lPETS: &7You have spawned your &aChicken &7pet!" to player
- spawnpet(player, "Chicken")
- if player's tool is {CowPet}:
- send "&9&lPETS: &7You have spawned your &eCow &7pet!" to player
- spawnpet(player, "Cow")
- if player's tool is {TigerPet}:
- send "&9&lPETS: &7You have spawned your &6Tiger &7pet!" to player
- spawnpet(player, "Tiger")
- if player's tool is {TurtlePet}:
- send "&9&lPETS: &7You have spawned your &aTurtle &7pet!" to player
- spawnpet(player, "Turtle")
- if player's tool is {GuardianPet}:
- send "&9&lPETS: &7You have spawned your &eGuardian &7pet!" to player
- spawnpet(player, "Guardian")
- if player's tool is {SharkPet}:
- send "&9&lPETS: &7You have spawned your &6Shark &7pet!" to player
- spawnpet(player, "Shark")
- if player's tool is {VillagerPet}:
- send "&9&lPETS: &7You have spawned your &aVillager &7pet!" to player
- spawnpet(player, "Villager")
- if player's tool is {BirdPet}:
- send "&9&lPETS: &7You have spawned your &eBird &7pet!" to player
- send "&9&l- &7Flight mode has been enabled!" to player
- spawnpet(player, "Bird")
- set player's flight mode to true
- if player has permission "rank.coal":
- set player's flight speed to 0.3
- send "&9&l- &7Flight mode has been set to &fx2&7!" to player
- if player's tool is {EndermanPet}:
- send "&9&lPETS: &7You have spawned your &6Enderman &7pet!" to player
- spawnpet(player, "Enderman")
- if player's tool is {TimePet}:
- send "&9&lPETS: &7You have spawned your <##f39de8>Time &7pet!" to player
- spawnpet(player, "Time")
- stop
- play sound "block.note_block.bass" with pitch 2 to player
- send "&9&lPETS: &7You can only spawn pets in the /spawn region!" to event-player
- stop
- if {SpawnedPet::%UUID of player%} is alive:
- if display name of {SpawnedPet::%UUID of player%} contains "Bird":
- set player's flight mode to false
- set player's flight speed to 0.2
- play sound "entity.item.pickup" with pitch 1 to player
- play sound "entity.ender_dragon.flap" with pitch 2 to player
- draw 25 poof at location 2.25 meters above {SpawnedPet::%UUID of player%} with offset vector(0, 0, 0) with extra 0.2
- kill {SpawnedPet::%UUID of player%}
- delete {SpawnedPet::%UUID of player%}
- send "&9&lPETS: &7You have de-spawned your pet!" to player
- stop
- function spawnpet(p:player, t:text):
- wait 1 tick
- set {_uuidp} to UUID of {_p}
- if {_t} is "Chicken" or "Cow" or "Tiger" or "Turtle" or "Guardian" or "Shark" or "Villager" or "Bird" or "Enderman" or "Time":
- spawn 1 armor stand at location 1 meters in front of {_p} with nbt from "{NoGravity:1b,Invulnerable:1,Invisible:1}"
- if {_t} is "Chicken":
- set helmet of last spawned armor stand to {ChickenSkull}
- set display name of last spawned armor stand to "&a%{_p}% Chicken Pet"
- if {_t} is "Cow":
- set helmet of last spawned armor stand to {CowSkull}
- set display name of last spawned armor stand to "&e%{_p}% Cow Pet"
- if {_t} is "Tiger":
- set helmet of last spawned armor stand to {TigerSkull}
- set display name of last spawned armor stand to "&6%{_p}% Tiger Pet"
- if {_t} is "Turtle":
- set helmet of last spawned armor stand to {TurtleSkull}
- set display name of last spawned armor stand to "&a%{_p}% Turtle Pet"
- if {_t} is "Guardian":
- set helmet of last spawned armor stand to {GuardianSkull}
- set display name of last spawned armor stand to "&e%{_p}% Guardian Pet"
- if {_t} is "Shark":
- set helmet of last spawned armor stand to {SharkSkull}
- set display name of last spawned armor stand to "&6%{_p}% Shark Pet"
- if {_t} is "Villager":
- set helmet of last spawned armor stand to {VillagerSkull}
- set display name of last spawned armor stand to "&a%{_p}% Villager Pet"
- if {_t} is "Bird":
- set helmet of last spawned armor stand to {BirdSkull}
- set display name of last spawned armor stand to "&e%{_p}% Bird Pet"
- if {_t} is "Enderman":
- set helmet of last spawned armor stand to {EndermanSkull}
- set display name of last spawned armor stand to "&6%{_p}% Enderman Pet"
- if {_t} is "Time":
- set helmet of last spawned armor stand to {GoldClockSkull}
- set display name of last spawned armor stand to "<##f39de8>%{_p}% Golden Clock"
- set {_SpawnedPet::%{_uuidp}%} to last spawned armor stand
- teleport {SpawnedPet::%{_uuidp}%} to location 1 meters below {SpawnedPet::%{_uuidp}%}
Advertisement
Add Comment
Please, Sign In to add comment