Date: 2020/01/11 16:23:10 UTC-08:00
Type: Denizen Script
cube:
type: command
name: cube
description: "Saves your WorldEdit selection as a Denizen notable cuboid"
usage: /cube CubeName to save a worldedit selection, put "SavedCubeName delete" without the quotes to remove a saved cube
permission: <player.is_op>
permission message: "Sorry, <player.name>, you can't use this command because you aren't OP"
tab complete:
- if <context.args.size||0> == 0:
- determine <server.list_notables[cuboids].parse[notable_name]>
- else if <context.args.size> == 1 && <context.raw_args.ends_with[<&sp>].not>:
- determine <server.list_notables[cuboids].parse[notable_name].filter[starts_with[<context.args.get[1]>]]>
- else if <context.args.size> == 1 && <context.raw_args.ends_with[<&sp>]> && <server.list_notables[cuboids].parse[notable_name].contains[<context.args[1]>]>:
- determine delete
script:
- choose <context.args.size>:
- case 1:
- if <player.we_selection||null> != null:
- note <player.we_selection> as:<context.args.get[1]>
- narrate "<context.args.get[1]> = <player.we_selection>"
- else:
- narrate "A Worldedit selection is required for this command."
- case 2:
- if <context.args.get[2].contains_text[delete].not>:
- narrate "Sorry, cube names can't have spaces"
- stop
- note remove as:<context.args.get[1]>
- narrate "<context.args.get[1]> deleted"
- default:
- narrate "Sorry, cube names can't have spaces"