options: tp-y: entity.cat.ambient tp-x: entity.villager.hurt on first join: set {status.home.1::%uuid of player%} to "&c&l❌" set {status.home.2::%uuid of player%} to "&c&l❌" set {status.home.3::%uuid of player%} to "&c&l❌" command /home []: aliases: dom, domy, homes trigger: set {_gui} to chest inventory with 1 rows named "Domy" set slot 3 of {_gui} to lime bed named "&fDom &a##1" with lore "&3Status &7- %{status.home.1::%uuid of player%}%%nl%&2LPM &7-&a Teleportacja do domu%nl%&6PPM &7- &eUstawienie domu" set slot 4 of {_gui} to yellow bed named "&fDom &e##2" with lore "&3Status &7- %{status.home.2::%uuid of player%}%%nl%&2LPM &7-&a Teleportacja do domu%nl%&6PPM &7- &eUstawienie domu" set slot 5 of {_gui} to red bed named "&fDom &c##3" with lore "&3Status &7- %{status.home.3::%uuid of player%}%%nl%&2LPM &7-&a Teleportacja do domu%nl%&6PPM &7- &eUstawienie domu" set slot 8 of {_gui} to book named "&7Informacje:" with lore "&fStatus &c&l❌&f oznacza brak ustawionego domu,%nl%&fa natomiast status &a&l✔ &foznacza ustawiony dom." open {_gui} to player on inventory click: event-inventory is not player's inventory if name of event-inventory is "Domy": cancel event if clicked slot is 3: if "%click type%" contains "RIGHT": if block below player is not air: set {home.1::%uuid of player%} to location of player set {status.home.1::%uuid of player%} to "&a&l✔" send "&aUstawiono Dom ##1" to player close player's inventory else: send "&cNie możesz ustawiać domu będąc w niebie!" play sound "{@tp-x}" to player if "%click type%" contains "LEFT": if {home.1::%uuid of player%} is set: set {_} to "%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" set {home.timer::%player%} to 5 loop 5 times: send action bar "&fTeleportacja za: %{home.timer::%player%}%s" to player remove 1 from {home.timer::%player%} wait 1 second if {_} is "%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%": teleport player to {home.1::%uuid of player%} send "&aPrzeteleportowano." play sound "{@tp-y}" to player else: send "&cTeleportacja została anulowana z powodu ruchu!" play sound "{@tp-x}" to player cancel event else: send "&cNie ustawiłeś jeszcze tego domu!" cancel event if clicked slot is 4: if "%click type%" contains "RIGHT": if block below player is not air: set {home.2::%uuid of player%} to location of player set {status.home.2::%uuid of player%} to "&a&l✔" send "&aUstawiono Dom ##2" to player close player's inventory else: send "&cNie możesz ustawiać domu będąc w niebie!" play sound "{@tp-x}" to player if "%click type%" contains "LEFT": if {home.2::%uuid of player%} is set: set {_} to "%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" set {home.timer::%player%} to 5 loop 5 times: send action bar "&fTeleportacja za: %{home.timer::%player%}%s" to player remove 1 from {home.timer::%player%} wait 1 second if {_} is "%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%": teleport player to {home.2::%uuid of player%} send "&aPrzeteleportowano." play sound "{@tp-y}" to player else: send "&cTeleportacja została anulowana z powodu ruchu!" play sound "{@tp-x}" to player cancel event else: send "&cNie ustawiłeś jeszcze tego domu!" cancel event if clicked slot is 5: if "%click type%" contains "RIGHT": if block below player is not air: set {home.3::%uuid of player%} to location of player set {status.home.3::%uuid of player%} to "&a&l✔" send "&aUstawiono Dom ##3" to player close player's inventory else: send "&cNie możesz ustawiać domu będąc w niebie!" play sound "{@tp-x}" to player if "%click type%" contains "LEFT": if {home.3::%uuid of player%} is set: set {_} to "%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%" set {home.timer::%player%} to 5 loop 5 times: send action bar "&fTeleportacja za: %{home.timer::%player%}%s" to player remove 1 from {home.timer::%player%} wait 1 second if {_} is "%x-coordinate of player%, %y-coordinate of player%, %z-coordinate of player%": teleport player to {home.3::%uuid of player%} send "&aPrzeteleportowano." play sound "{@tp-y}" to player else: send "&cTeleportacja została anulowana z powodu ruchu!" play sound "{@tp-x}" to player cancel event else: send "&cNie ustawiłeś jeszcze tego domu!" cancel event on command: if {home.timer::%player%} is 5 or 4 or 3 or 2 or 1: send "&cNie można używać komend podczas teleportacji!" cancel event