Paste #21338: Untitled Paste

Date: 2015/10/21 22:45:18 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


setting_spawn:
    Type: command
    debug: true
    name: SetSpawn
    description: <&9>Sets the world Spawn Point to the location you are at
    usage: /setspawn <&lt>world<&gt>
#    permission: yeticraft.cmd.setspawn
    script:
        - if <context.server> {
            - narrate "<&c> WHAO<&co> <&e>You must be a player in-game to run this command"
            - queue clear
        }
#        - if <player.has_permission[yeticraft.cmd.setspawn].not> {
#            - narrate "<&c>You do not have permission to set the world spawn"
#            - queue clear
#        }
        - define here l@<player.location.block.x.add[.5]>,<player.location.block.y.add[.5]>,<player.location.block.z.add[.5]>,<player.location.pitch>,<player.location.yaw>,<player.world>
        - define world <context.args.get[1]||null>
        - if <def[world]> == null {
            - define world <player.world>
        }
        - if <def[world]> != <server.list_worlds> {
            - narrate "<&c>Could not find <&6>%world%<&c>, are you sure it loaded?"
            - queue clear
        }
        - flag server %world%_spawnpoint:%here%