Paste #52864: Untitled Paste

Date: 2019/02/27 13:16:41 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


CLAIMSCOMMAND:
  type: command
  debug: false
  name: c
  description: Main Claims command.
  usage: /c <&lt>subcommand<&gt>
  permission: claims.op
  aliases: li@
  tab complete:
    - define subcommand "<context.args.get[1]||>"
    - define subcommands "<custom@CLAIMS.subcommands>"
    - if "<def[subcommands].contains[<def[subcommand]>].not>":
      - determine "<def[subcommands].filter[starts_with[<def[subcommand]>]]>"
    - inject s@CLAIMSCOMMAND_<def[subcommand]> "path:tab complete" instantly
  script:
    - define subcommand "<context.args.get[1]||null>"
    - if "<def[subcommand]>" == null:
      - narrate "<&6>Specify the subcommand you wish to run."
      - narrate "<&6>Usage<&co> <&c><&dq>/c <&lt>subcommand<&gt><&dq><&6>."
      - playsound "<player>" "sound:ENTITY_VILLAGER_NO"
      - queue clear
    - define subcommands "<custom@CLAIMS.subcommands>"
    - if "<def[subcommands].contains[<def[subcommand]>].not>":
      - narrate "<&c><&dq><def[subcommand]><&dq> <&6>is not a valid subcommand."
      - playsound "<player>" "sound:ENTITY_VILLAGER_NO"
      - queue clear
    - inject s@CLAIMSCOMMAND_<def[subcommand]> instantly