Home & Sethome Commands (Essentials Remake)
Author: OzOwnz
Created: 2014-07-19T19:41:29-0400
Edited: 2014-07-19T19:41:29-0400
Denizen Version: 0.9.5-SNAPSHOT
Views: 1
Downloads: 795
Likes: 0
Description: Requires the addition of a script that, if teleportation is not allowed in the region of which the player is in, to clear this command's queue and determine it fulfilled.
Allows the setting of one home. Will display your previous home location/coordinates upon overwriting.
/sethome
/home
Home Controller:
type: world
events:
on sethome command:
- ^inject teleportation_allowed
- ^if <c.args.get[1]> == null {
- ^if <player.flag[home]> != null ^narrate "Overwriting existing home..."
- ^if <player.flag[home]> != null ^narrate "Previous home location<&co> <&e><player.flag[home].as_location.x.as_int>, <player.flag[home].as_location.y.as_int>, <player.flag[home].as_location.z.as_int>, <player.flag[home].as_location.world.name>"
- ^flag player home:<player.location>
- ^narrate "Home set."
- ^execute as_server "denizen save"
- determine fulfilled
- queue clear
}
else {
- ^narrate "<&c>Usage<&co> /sethome"
- determine fulfilled
- queue clear
}
on home command:
- ^inject teleportation_allowed
- ^if <player.flag[home]> != null {
- ^teleport <player> <player.flag[home]>
- ^narrate "Home teleportation successful."
- determine fulfilled
- queue clear
}
- ^narrate "<&f>No home set. Use /sethome"
- determine fulfilled
- queue clear