on load: if file "plugins/NowPet/lang.yml" does not exists: create file "plugins/NowPet/lang.yml" wf "color-mob: &2" to "plugins/NowPet/lang.yml" set {color-mob} to value "color-mob" get of "plugins/NowPet/lang.yml" wf "color-kill: &c" to "plugins/NowPet/lang.yml" set {color-kill} to value "color-kill" get of "plugins/NowPet/lang.yml" wf "name-default-pet: &aPet de &2" to "plugins/NowPet/lang.yml" set {name-default-pet} to value "name-default-pet" get of "plugins/NowPet/lang.yml" wf "invok-pet: &aVous avez invoquer votre pet !" to "plugins/NowPet/lang.yml" set {invok-pet} to value "invok-pet" get of "plugins/NowPet/lang.yml" wf "alerdy-pet: &cVous avez déjà un pet !" to "plugins/NowPet/lang.yml" set {alerdy-pet} to value "alerdy-pet" get of "plugins/NowPet/lang.yml" wf "kill-pet: &aVous avez tuer votre pet !" to "plugins/NowPet/lang.yml" set {kill-pet} to value "kill-pet" get of "plugins/NowPet/lang.yml" wf "no-pet: &cVous n'avez pas de pet !" to "plugins/NowPet/lang.yml" set {no-pet} to value "no-pet" get of "plugins/NowPet/lang.yml" wf "ride-pet: &aVous monter sur votre pet !" to "plugins/NowPet/lang.yml" set {ride-pet} to value "ride-pet" get of "plugins/NowPet/lang.yml" if file "plugins/NowPet/lang.yml" exists: set {color-mob} to value "color-mob" get of "plugins/NowPet/lang.yml" set {color-kill} to value "color-kill" get of "plugins/NowPet/lang.yml" set {name-default-pet} to value "name-default-pet" get of "plugins/NowPet/lang.yml" set {invok-pet} to value "invok-pet" get of "plugins/NowPet/lang.yml" set {alerdy-pet} to value "alerdy-pet" get of "plugins/NowPet/lang.yml" set {kill-pet} to value "kill-pet" get of "plugins/NowPet/lang.yml" set {no-pet} to value "no-pet" get of "plugins/NowPet/lang.yml" set {ride-pet} to value "ride-pet" get of "plugins/NowPet/lang.yml" if file "plugins/NowPet/config.yml" does not exists: create file "plugins/NowPet/config.yml" wf "gui-name-cmd: &aNowPet" to "plugins/NowPet/config.yml" set {gui-name-cmd} to value "gui-name-cmd" get of "plugins/NowPet/config.yml" wf "gui-name-pet: &aNowPet &8> &aPet" to "plugins/NowPet/config.yml" set {gui-name-pet} to value "gui-name-pet" get of "plugins/NowPet/config.yml" if file "plugins/NowPet/config.yml" exists: set {gui-name-cmd} to value "gui-name-cmd" get of "plugins/NowPet/config.yml" set {gui-name-pet} to value "gui-name-pet" get of "plugins/NowPet/config.yml" command /nowpet [] []: trigger: if arg 1 is not set: if arg 2 is not set: play "NOTE_PIANO" to player at volume 1 open chest with 6 rows named "%{gui-name-cmd}%" to player wait 2 tick set {gui.loop} to 0 loop 10 times: format slot {gui.loop} of player with glass pane named " " to run [execute player command "wl"] add 1 to {gui.loop} set {gui.loop} to 44 loop 10 times: format slot {gui.loop} of player with glass pane named " " to run [execute player command "wl"] add 1 to {gui.loop} format slot 17 of player with glass pane named " " to run [execute player command "wl"] format slot 18 of player with glass pane named " " to run [execute player command "wl"] format slot 26 of player with glass pane named " " to run [execute player command "wl"] format slot 27 of player with glass pane named " " to run [execute player command "wl"] format slot 35 of player with glass pane named " " to run [execute player command "wl"] format slot 36 of player with glass pane named " " to run [execute player command "wl"] format slot 10 of player with cow spawn egg named "%{color-mob}%Vache" to run [execute player command "nowpet spawn cow"] format slot 11 of player with sheep spawn egg named "%{color-mob}%Mouton" to run [execute player command "nowpet spawn sheep"] format slot 12 of player with wolf spawn egg named "%{color-mob}%Loup" to run [execute player command "nowpet spawn wolf"] format slot 13 of player with giant spawn egg named "%{color-mob}%Zombie Géant" to run [execute player command "nowpet spawn giant"] format slot 14 of player with zombie spawn egg named "%{color-mob}%Zombie" to run [execute player command "nowpet spawn zombie"] format slot 15 of player with enderman spawn egg named "%{color-mob}%Enderman" to run [execute player command "nowpet spawn enderman"] format slot 16 of player with chicken spawn egg named "%{color-mob}%Poule" to run [execute player command "nowpet spawn chicken"] format slot 19 of player with pig spawn egg named "%{color-mob}%Cochon" to run [execute player command "nowpet spawn pig"] format slot 20 of player with horse spawn egg named "%{color-mob}%Cheval" to run [execute player command "nowpet spawn horse"] format slot 21 of player with villager spawn egg named "%{color-mob}%Villageoi" to run [execute player command "nowpet spawn villager"] format slot 22 of player with iron golem spawn egg named "%{color-mob}%Goleme de fer" to run [execute player command "nowpet spawn iron golem"] format slot 23 of player with mooshroom spawn egg named "%{color-mob}%Vache champignon" to run [execute player command "nowpet spawn mooshroom"] format slot 24 of player with squid spawn egg named "%{color-mob}%Poulpe" to run [execute player command "nowpet spawn squid"] format slot 25 of player with spider spawn egg named "%{color-mob}%Araignée" to run [execute player command "nowpet spawn spider"] format slot 28 of player with blaze spawn egg named "%{color-mob}%Blaze" to run [execute player command "nowpet spawn blaze"] format slot 43 of player with dye:1 named "%{color-kill}%Tuer votre pet" to run [execute player command "nowpet delete"] if arg 1 is "spawn": if arg 2 is set: if {nowpet.getpet.%UUID of player%} is not set: play "NOTE_PIANO" to player at volume 1 spawn arg 2 at player set {nowpet.getpet.%UUID of player%} to true set {nowpet.pet.%UUID of player%} to arg 2 set helmet of the spawned entity to chain helmet set name of spawned entity to "%{name-default-pet}%%player%" send "%{invok-pet}%" to player add spawned entity to {nowpet.follow.%UUID of player%::*} while spawned entity exists: make spawned entity pathfind to player with speed 2 wait 1 tick else if {nowpet.getpet.%UUID of player%} is true: send "%{alerdy-pet}%" if arg 1 is "delete": if arg 2 is not set: if {nowpet.getpet.%UUID of player%} is true: loop {nowpet.follow.%UUID of player%::*}: kill loop-value clear {nowpet.getpet.%UUID of player%} clear {nowpet.pet.%UUID of player%} clear {nowpet.follow.%UUID of player%::*} send "%{kill-pet}%" to player else if {nowpet.getpet.%UUID of player%} is not set: send "%{no-pet}%" if arg 1 is "ride": if arg 2 is not set: if {nowpet.getpet.%UUID of player%} is true: play "NOTE_PIANO" to player at volume 1 loop {nowpet.follow.%UUID of player%::*}: make player ride loop-value send "%{ride-pet}%" to player else if {nowpet.getpet.%UUID of player%} is not set: send "%{no-pet}%" on damage of player: if {nowpet.follow.%UUID of victim%::*} contains attacker: cancel event on damage of entity: if {nowpet.follow.%UUID of attacker%::*} contains victim: damage cause is attack: cancel event if {nowpet.follow.%UUID of attacker%::*} contains victim: play "NOTE_PIANO" to attacker at volume 1 open chest with 1 rows named "%{gui-name-pet}%" to attacker wait 2 tick format slot 3 of attacker with saddle named "%{color-mob}%Monter" to run [execute attacker command "nowpet ride"] format slot 5 of attacker with dye:1 named "%{color-kill}%Tuer" to run [execute attacker command "nowpet delete"] damage cause is fall: cancel event on death: clear drops on rightclick on horse or villager: if {nowpet.getpet.%UUID of player%} is true: cancel event on vehicle steer: if event-button is space: push vehicle of player upwards at speed 0.6 if event-button is w: push vehicle of player in the direction of player at speed 1 if event-button is a: push vehicle of player to the left at speed 0.6 if event-button is d: push vehicle of player to the right at speed 0.6 if event-button is s: push vehicle of player backwards at speed 0.6d