options:
gui: &8&lHomes GUI
nohome: &c&lHome %{_home}% &chas not been set.
nohomeGUI: &c&lHome %{_home}% &chas not been set
noperm: &4Error: &cYou don't have permission.
on inventory click:
if name of event-inventory contains "Confirm remove":
cancel event
if index of event-slot is 12:
play sound "UI_BUTTON_CLICK" to player
clear {home.%{home.number::%player's uuid%}%::%player's uuid%}
send "&c&lHome %{home.number::%player's uuid%}% &chas been removed." to player
make player execute command "/home"
if index of event-slot is 14:
play sound "UI_BUTTON_CLICK" to player
make player execute command "/home"
if name of event-inventory is "{@gui}":
cancel event
if index of event-slot is 22:
play sound "UI_BUTTON_CLICK" to player
close player's inventory
if index of event-slot is between 0 and 8:
play sound "UI_BUTTON_CLICK" to player
close player's inventory
if index of event-slot is between 9 and 17:
play sound "UI_BUTTON_CLICK" to player
#==============================================================================================
# Set Home Icon
#==============================================================================================
set {_home} to 1
set {_slot.bed} to 2
set {_slot.opt} to 11
clear {home.number::%player's uuid%}
#1
if index of event-slot is {_slot.opt}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is not set:
set {home.%{_home}%::%player's uuid%} to location of player
set slot {_slot.opt} of event-inventory to lime dye named "&cClick to remove"
set slot {_slot.bed} of event-inventory to red bed named "&a&lHome %{_home}%"
send "&a&lHome %{_home}% &ahas been set at current location." to player
else:
set {_gui} to chest inventory with 3 rows named "&eConfirm remove &lHome %{_home}%?"
set slot 4 of {_gui} to red bed named "&a&lHome %{_home}%"
set slot 12 of {_gui} to lime dye named "&aConfirm"
set slot 14 of {_gui} to red dye named "&cCancel"
set {home.number::%player's uuid%} to {_home}
open {_gui} to player
else:
close player's inventory
send "{@noperm}" to player
add 1 to {_slot.opt} and {_slot.bed} and {_home}
#2
if index of event-slot is {_slot.opt}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is not set:
set {home.%{_home}%::%player's uuid%} to location of player
set slot {_slot.opt} of event-inventory to lime dye named "&cClick to remove"
set slot {_slot.bed} of event-inventory to red bed named "&a&lHome %{_home}%"
send "&a&lHome %{_home}% &ahas been set at current location." to player
else:
set {_gui} to chest inventory with 3 rows named "&eConfirm remove Home %{_home}%?"
set slot 4 of {_gui} to red bed named "&a&lHome %{_home}%"
set slot 12 of {_gui} to lime dye named "&aConfirm"
set slot 14 of {_gui} to red dye named "&cCancel"
set {home.number::%player's uuid%} to {_home}
open {_gui} to player
else:
close player's inventory
send "{@noperm}" to player
add 1 to {_slot.opt} and {_slot.bed} and {_home}
#3
if index of event-slot is {_slot.opt}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is not set:
set {home.%{_home}%::%player's uuid%} to location of player
set slot {_slot.opt} of event-inventory to lime dye named "&cClick to remove"
set slot {_slot.bed} of event-inventory to red bed named "&a&lHome %{_home}%"
send "&a&lHome %{_home}% &ahas been set at current location." to player
else:
set {_gui} to chest inventory with 3 rows named "&eConfirm remove Home %{_home}%?"
set slot 4 of {_gui} to red bed named "&a&lHome %{_home}%"
set slot 12 of {_gui} to lime dye named "&aConfirm"
set slot 14 of {_gui} to red dye named "&cCancel"
set {home.number::%player's uuid%} to {_home}
open {_gui} to player
else:
close player's inventory
send "{@noperm}" to player
add 1 to {_slot.opt} and {_slot.bed} and {_home}
#4
if index of event-slot is {_slot.opt}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is not set:
set {home.%{_home}%::%player's uuid%} to location of player
set slot {_slot.opt} of event-inventory to lime dye named "&cClick to remove"
set slot {_slot.bed} of event-inventory to red bed named "&a&lHome %{_home}%"
send "&a&lHome %{_home}% &ahas been set at current location." to player
else:
set {_gui} to chest inventory with 3 rows named "&eConfirm remove Home %{_home}%?"
set slot 4 of {_gui} to red bed named "&a&lHome %{_home}%"
set slot 12 of {_gui} to lime dye named "&aConfirm"
set slot 14 of {_gui} to red dye named "&cCancel"
set {home.number::%player's uuid%} to {_home}
open {_gui} to player
else:
close player's inventory
send "{@noperm}" to player
add 1 to {_slot.opt} and {_slot.bed} and {_home}
#5
if index of event-slot is {_slot.opt}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is not set:
set {home.%{_home}%::%player's uuid%} to location of player
set slot {_slot.opt} of event-inventory to lime dye named "&cClick to remove"
set slot {_slot.bed} of event-inventory to red bed named "&a&lHome %{_home}%"
send "&a&lHome %{_home}% &ahas been set at current location." to player
else:
set {_gui} to chest inventory with 3 rows named "&eConfirm remove Home %{_home}%?"
set slot 4 of {_gui} to red bed named "&a&lHome %{_home}%"
set slot 12 of {_gui} to lime dye named "&aConfirm"
set slot 14 of {_gui} to red dye named "&cCancel"
set {home.number::%player's uuid%} to {_home}
open {_gui} to player
else:
close player's inventory
send "{@noperm}" to player
#==============================================================================================
# Home Bed Icon
#==============================================================================================
#Home 1
set {_slot.bed} to 2
set {_home} to 1
if index of event-slot is {_slot.bed}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is set:
set {_x} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
loop 5 times:
set {_check} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
set {_num} to loop-number
if {_check} is not {_x}:
send action bar "&cTeleportation cancelled" to player
#send "&cTeleportation cancelled." to player
play sound "BLOCK_ANVIL_LAND" to player
stop
else:
send action bar "&aTeleporting in %6-{_num}% seconds" to player
#send "&aTeleporting in %6-{_num}% second. Do not move." to player
play sound "BLOCK_NOTE_BLOCK_PLING" with pitch 10 to player
wait a second
send action bar "&aTeleported to &a&l&a&lHome %{_home}%" to player
#send "&aTeleported to Home #%{_home}%." to player
teleport player to {home.%{_home}%::%player's uuid%}
wait a tick
play sound "ENTITY_ENDERMAN_TELEPORT" with pitch 0.5 to player
apply blindness 2 without particles to the player for 1 second
else:
send "{@nohome}" to player
else:
send "{@noperm}" to player
add 1 to {_slot.bed} and {_home}
#Home 2
if index of event-slot is {_slot.bed}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is set:
set {_x} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
loop 5 times:
set {_check} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
set {_num} to loop-number
if {_check} is not {_x}:
send action bar "&cTeleportation cancelled" to player
send "&cTeleportation cancelled." to player
play sound "BLOCK_ANVIL_LAND" to player
stop
else:
send action bar "&aTeleporting in %6-{_num}% second" to player
#send "&aTeleporting in %6-{_num}% second. Do not move." to player
play sound "BLOCK_NOTE_BLOCK_PLING" to player
wait a second
send action bar "&aTeleported to &a&lHome %{_home}%" to player
#send "&aTeleported to Home #%{_home}%." to player
teleport player to {home.%{_home}%::%player's uuid%}
wait a tick
play sound "ENTITY_ENDERMAN_TELEPORT" with pitch 0.5 to player
else:
send "{@nohome}" to player
else:
send "{@noperm}" to player
add 1 to {_slot.bed} and {_home}
#Home 3
if index of event-slot is {_slot.bed}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is set:
set {_x} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
loop 5 times:
set {_check} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
set {_num} to loop-number
if {_check} is not {_x}:
send action bar "&cTeleportation cancelled" to player
send "&cTeleportation cancelled." to player
play sound "BLOCK_ANVIL_PLACE" to player
stop
else:
send action bar "&aTeleporting in %6-{_num}% second" to player
#send "&aTeleporting in %6-{_num}% second. Do not move." to player
play sound "BLOCK_NOTE_BLOCK_PLING" to player
wait a second
send action bar "&aTeleported to &a&lHome %{_home}%" to player
#send "&aTeleported to Home #%{_home}%." to player
teleport player to {home.%{_home}%::%player's uuid%}
wait a tick
play sound "ENTITY_ENDERMAN_TELEPORT" with pitch 0.5 to player
else:
send "{@nohome}" to player
else:
send "{@noperm}" to player
add 1 to {_slot.bed} and {_home}
#Home 4
if index of event-slot is {_slot.bed}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is set:
set {_x} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
loop 5 times:
set {_check} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
set {_num} to loop-number
if {_check} is not {_x}:
send action bar "&cTeleportation cancelled" to player
send "&cTeleportation cancelled." to player
play sound "BLOCK_ANVIL_PLACE" to player
stop
else:
send action bar "&aTeleporting in %6-{_num}% second" to player
#send "&aTeleporting in %6-{_num}% second. Do not move." to player
play sound "BLOCK_NOTE_BLOCK_PLING" to player
wait a second
send action bar "&aTeleported to &a&lHome %{_home}%" to player
#send "&aTeleported to Home #%{_home}%." to player
teleport player to {home.%{_home}%::%player's uuid%}
wait a tick
play sound "ENTITY_ENDERMAN_TELEPORT" with pitch 0.5 to player
else:
send "{@nohome}" to player
else:
send "{@noperm}" to player
add 1 to {_slot.bed} and {_home}
#Home 5
if index of event-slot is {_slot.bed}:
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is set:
set {_x} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
loop 5 times:
set {_check} to location(player's x-coordinate, player's y-coordinate, player's z-coordinate, player's world)
set {_num} to loop-number
if {_check} is not {_x}:
send action bar "&cTeleportation cancelled" to player
send "&cTeleportation cancelled." to player
play sound "BLOCK_ANVIL_PLACE" to player
stop
else:
send action bar "&aTeleporting in %6-{_num}% second" to player
#send "&aTeleporting in %6-{_num}% second. Do not move." to player
play sound "BLOCK_NOTE_BLOCK_PLING" to player
wait a second
send action bar "&aTeleported to &a&lHome %{_home}%" to player
#send "&aTeleported to Home #%{_home}%." to player
teleport player to {home.%{_home}%::%player's uuid%}
wait a tick
play sound "ENTITY_ENDERMAN_TELEPORT" with pitch 0.5 to player
else:
send "{@nohome}" to player
else:
send "{@noperm}" to player
#==============================================================================================
# Commands
#==============================================================================================
command /home:
description: Show homes GUI.
executable by: player
usage: &4Usage: &c/home
trigger:
set {_gui} to chest inventory with 3 rows named "{@gui}"
loop 5 times:
set {_home} to loop-number
set {confirm.%player's uuid%.%{_home}%} to false
if player has permission "offline.home.%{_home}%":
if {home.%{_home}%::%player's uuid%} is not set:
set slot {_home}+1 of {_gui} to light gray bed named "{@nohomeGUI}"
set slot {_home}+10 of {_gui} to gray dye named "&aClick to set"
else:
set {_x} to {home.%{_home}%::%player's uuid%}'s x-coordinate
set {_y} to {home.%{_home}%::%player's uuid%}'s y-coordinate
set {_z} to {home.%{_home}%::%player's uuid%}'s z-coordinate
set slot {_home}+1 of {_gui} to red bed named "&a&lHome %{_home}%"
set slot {_home}+10 of {_gui} to lime dye named "&cClick to remove"
else:
if {home.%{_home}%::%player's uuid%} is not set:
set slot {_home}+1 of {_gui} to light gray bed named "{@nohomeGUI}" with lore "&cNo permission"
set slot {_home}+10 of {_gui} to gray dye named "&cNo permission"
else:
set slot {_home}+1 of {_gui} to red bed named "&c&lHome %{_home}%" with lore "&cNo permission"
set slot {_home}+10 of {_gui} to lime dye named "&cNo permission"
set slot 22 of {_gui} to nether star with name "&cClose"
open {_gui} to player
command /delallhome [<player>]:
permission: op
trigger:
if arg-1 is not set:
loop 5 times:
add 1 to {_home}
clear {home.%{_home}%::%player's uuid%}
clear {_home}
send "&aYou cleared all of your Homes." to command sender
else:
loop 5 times:
add 1 to {_home}
clear {home.%{_home}%::%arg-1's uuid%}
clear {_home}
send "&aYou cleared all of %arg-1% Homes." to command sender