healchero

customcommands_commands.yml

Jun 15th, 2018
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 12.29 KB | None | 0 0
  1. #----------------------------------------------------------------------------------------------------
  2. # Configuration for your custom commands
  3. #----------------------------------------------------------------------------------------------------
  4. # Configurations details and description for a command (see the examples below to understand exactly what it does and how to use it)
  5. #   - (mandatory) aliases (list) : all the aliases the player can type to use your command. The first alias of the list is the one that will be used in display texts (for example, help).
  6. #   - (mandatory) arguments (config section) : you'll add the arguments patterns you want. If you don't want the player to be able to enter arguments, you'll add a simple arguments object with an empty pattern.
  7. # And that's all for the command itself. If you don't specify any arguments nobody will be able to perform the command, even with no arguments. See below for examples.
  8. #----------------------------------------------------------------------------------------------------
  9. # Configuration details and description for arguments (see the example below to understand exactly what it does and how to use it)
  10. #   - (mandatory) pattern (text) : the pattern for the command (see just below for explanations, 'Arguments patterns')
  11. #   - (mandatory) description (text) : a description of the command (display use only)
  12. #   - (optional) permission (text) : a permission required to use the command
  13. #   - (optional) worlds (list) : optional, if you specify this, the arguments will only work in those worlds
  14. #   - (mandatory) perform (section) : a list of actions (see details below) that will be executed when the player runs the argument
  15. #----------------------------------------------------------------------------------------------------
  16. # Arguments patterns
  17. # This is very important to understand, and it's easier than it looks.
  18. # A pattern is a text, between ''. It can be from an empty string (so the command can be performed with no arguments entered) to a complex pattern with default values.
  19. #
  20. # Every word of a pattern can be :
  21. #   - any word : the player will have to type the exact word (case doesn't matter though)
  22. #   - a number : [integer] (the player can type any integer he wants)
  23. #   - a decimal number : [double] (the player can type any double he wants)
  24. #   - a player : [player] (the player can type any player name he wants)
  25. #   - an online player : [player-online] (the player can type any online player name he wants)
  26. #   - a string : [string] (the player can type any word)
  27. #   - a sized string : [string:{min}:{max}] (the player can type any word within a range)
  28. #   - a phrase : [phrase] (can be added at the end only) (the player can type any words he wants (technically infinite but minecraft limit the commands size so most likely not more than 50 words)
  29. #
  30. # It's important to distinguish the MODEL arguments (the ones that can be filled with anything or something specific, the ones between []) and the STRING arguments (the one that the player has to enter fully)
  31. #
  32. # STRING arguments caracteristics :
  33. # - You can separate argument aliases with |
  34. #   --> example of pattern with aliases : 'teleport|tp [player]' (the command can be used by typing either 'teleport [player]' or 'tp [player]'
  35. # - You can NOT specify a default value with $
  36. # - You can NOT specify a description in help with %
  37. #
  38. # MODEL argument notes :
  39. # - You must specify a description with % to indicate what the argument is useful for. All _ will be replaced by spaces.
  40. #   --> example of correct MODEL argument : 'teleport [player]%target_player' (the command will display in help as 'teleport [target player]')
  41. # - You can specify a default value with $ so it'll mean that the argument is optional.
  42. #   Optional arguments are not required to type and if they're not typed the default value is used instead.
  43. #   You can NOT add required (non-optional) arguments after an optional argument.
  44. #   --> example of pattern with optional argument : 'give [player] stone [integer]$64' (the command can be used by typing either 'give [player] stone [integer]' or 'give [player]' (in that second case 64 will
  45. #       be used because the sender didn't specify that optional argument))
  46. #   --> Please note that this example is simplified and cannot be used as it because the descriptions of MODEL arguments are missing.
  47. #
  48. #----------------------------------------------------------------------------------------------------
  49. # Actions that you can use :
  50. #
  51. #  type: send message
  52. #  data:
  53. #    - target ('player', 'everyone', '$ARG:[NUMBER]')
  54. #    - message line 1 (placeholders : $ARGS, $PLAYER, $RECEIVER, $ARG:NUMBER, $ARGS:[STARTING NUMBER, included])
  55. #    - message line 2 (placeholders : $ARGS, $PLAYER, $RECEIVER, $ARG:NUMBER, $ARGS:[STARTING NUMBER, included])
  56. #    - ... etc
  57. #
  58. #  type: wait ticks
  59. #  data:
  60. #    - delay in ticks
  61. #
  62. #  type: execute commands for
  63. #  data:
  64. #    - command 1 (placeholders : $ARGS, $PLAYER, $ARG:NUMBER, $ARGS:[STARTING NUMBER, included])
  65. #    - command 2 (placeholders : $ARGS, $PLAYER, $ARG:NUMBER, $ARGS:[STARTING NUMBER, included])
  66. #    - ... etc
  67. #
  68. #  type: execute commands as
  69. #  data:
  70. #    - target ('player', 'everyone', '$ARG:[NUMBER]')
  71. #    - command 1 (placeholders : $ARGS, $PLAYER, $ARG:NUMBER, $ARGS:[STARTING NUMBER, included])
  72. #    - command 2 (placeholders : $ARGS, $PLAYER, $ARG:NUMBER, $ARGS:[STARTING NUMBER, included])
  73. #    - ... etc
  74. #
  75. #  type: send title
  76. #  data:
  77. #    - target ('player', 'everyone', '$ARG:[NUMBER]')
  78. #    - title (placeholders : $ARGS, $PLAYER, $RECEIVER, $ARG:NUMBER, $ARGS:[STARTING NUMBER, included])
  79. #    - subtitle (placeholders : $ARGS, $PLAYER, $RECEIVER, $ARG:NUMBER, $ARGS:[STARTING NUMBER, included])
  80. #    - fadein in ticks
  81. #    - duration in ticks
  82. #    - fadeout in ticks
  83. #
  84. #  type: send actionbar
  85. #  data:
  86. #    - target ('player', 'everyone', '$ARG:[NUMBER]')
  87. #    - the action bar (placeholders : $ARGS, $PLAYER, $RECEIVER, $ARG:NUMBER, $ARGS:[STARTING NUMBER, included])
  88. #
  89. #  type: give item
  90. #  data:
  91. #    - target ('player', 'everyone', '$ARG:[NUMBER]')
  92. #    - the item name (when you saved it with /ccmd saveitem [name])
  93. #
  94. #  type: teleport
  95. #  data:
  96. #    - target ('player', 'everyone', '$ARG:[NUMBER]')
  97. #    - the location name (when you saved it with /ccmd saveloc [name])
  98. #
  99. #  type: change gamemode
  100. #  data:
  101. #    - target ('player', 'everyone', '$ARG:[NUMBER]')
  102. #    - the gamemode id (0 = survival, 1 = creative, 2 = adventure, 3 = spectator (1.8+))
  103. #
  104. #  type: change tab
  105. #  data:
  106. #    - target ('player', 'everyone', '$ARG:[NUMBER]')
  107. #    - header
  108. #    - footer
  109. #
  110. #----------------------------------------------------------------------------------------------------
  111.  
  112. #----------------------------------------------------------------------------------------------------
  113. # Example 1 : a simple command that overrides the existing spawn commands
  114. #----------------------------------------------------------------------------------------------------
  115.  
  116. spawn:
  117.  
  118.   # Aliases : the command can be used with /spawn or /gotospawn
  119.   aliases:
  120.    - spawn
  121.     - gotospawn
  122.  
  123.   # Arguments : here we don't need argument so we only add one pattern with empty args
  124.   arguments:
  125.     1:
  126.      # Pattern : we don't need arguments, so it's empty
  127.       pattern: ''
  128.       # Description : arguments description ; what is that command going to do if you enter those arguments
  129.       description: go to the spawn
  130.       # Permission : the players will need to have the permission to use the command with those arguments
  131.       permission: myserver.permission.spawn
  132.       # Perform : actions that will be performed when the player uses the command with those arguments
  133.       perform:
  134.         1:
  135.           type: teleport
  136.           data:
  137.            - player
  138.             - my_spawn_location
  139.         2:
  140.           type: send message
  141.           data:
  142.            - player
  143.             - '&aAlright $PLAYER, you''re at spawn !'
  144.  
  145. #----------------------------------------------------------------------------------------------------
  146. # Example 2 : a command that shows informations about the server
  147. #----------------------------------------------------------------------------------------------------
  148.  
  149. helpserver:
  150.   # Aliases : the command can be used with /helpserver
  151.   aliases:
  152.    - helpserver
  153.  
  154.   # Arguments
  155.   arguments:
  156.  
  157.     # First arguments : help about the PVP. The full command to type will be /helpserver pvp or /helpserver combat or /helpserver fight
  158.     1:
  159.       pattern: 'pvp|combat|fight'
  160.       description: get informations about the pvp
  161.       perform:
  162.         1:
  163.           type: send message
  164.           data:
  165.            - 'player'
  166.             - '&aThe PVP is active on our server, only in the dedicated PVP arena. You can join the battle with /pvp !'
  167.             - '&7Thanks for using the /helpserver command.'
  168.    
  169.     # Second arguments : help about the shop. The full command to type will be /helpserver shop or /helpserver store
  170.     2:
  171.       pattern: 'shop|store'
  172.       description: get informations about the shop
  173.       perform:
  174.         1:
  175.           type: send message
  176.           data:
  177.            - 'player'
  178.             - '&aWe have a shop available to sell ranks or some cosmetic advantages, so you can support the server and help us to grow. It''s located at www.our-website.com/shop'
  179.             - '&7Thanks for using the /helpserver command.'
  180.  
  181.     # ... etc. You can add infinite arguments.
  182.  
  183. #----------------------------------------------------------------------------------------------------
  184. # Example 3 : more complex command that uses more arguments and toggles.
  185. #----------------------------------------------------------------------------------------------------
  186.  
  187. complex:
  188.  
  189.   # Aliases : the command can be used with /complex
  190.   aliases:
  191.    - complex
  192.  
  193.   # Arguments
  194.   arguments:
  195.  
  196.     # First arguments : sending a message
  197.     # The full command to type will be /complex say [player] [message (multiple words)]
  198.     # The command will be displayed in help as /complex say [target player] [message]
  199.     1:
  200.       pattern: 'say [player-online]%target_player [phrase]%message'
  201.       description: 'send a message to a player'
  202.       perform:
  203.         1:
  204.           type: send message
  205.           data:
  206.            - '$ARG:3'
  207.             # we send him the arguments starting at argument 3 included
  208.             - '&d[from $PLAYER]: &f$ARGS:3'
  209.    
  210.     # Second arguments : sending a poke (single word phrase) to the player, and this word is optional. -->  (poke) is between () below because it's optional
  211.     # The full command to type will be /complex poke [player] (poke)
  212.     # The command will be displayed in help as /complex say [target player] (poke message)
  213.     2:
  214.       pattern: 'poke [player-online]%target_player [string]$defaultpoke%poke_message'
  215.       # not everyone can poke so let's use a permission
  216.       permission: myserver.permission.poke
  217.       description: 'poke a player'
  218.       perform:
  219.         1:
  220.           type: send message
  221.           data:
  222.            - '$ARG:3'
  223.             # we send him the poke ; if the sender entered no third argument, 'defaultpoke' will be sent
  224.             - '&d[poke from $PLAYER]: &f$ARG:3'
  225.    
  226.     # Third arguments : just an example to show you how toggles work
  227.     # The full command to type will be /complex toggle test
  228.     # The command will be displayed in help as /complex toggle test
  229.     3:
  230.       pattern: 'toggle test'
  231.       permission: myserver.permission.toggletest
  232.       description: 'test the toggles'
  233.      
  234.       # If toggle=true, you'll have to specify perform_toggle_false= and perform_toggle_true= instead of only one perform=
  235.       toggle: true
  236.       # If toggle_persistent=true, the toggle state will be kept for each player even after a server restart/reload
  237.       toggle_persistent: true
  238.  
  239.       # Perform if toggle is currently false for the player when he typed the command
  240.       perform_toggle_false:
  241.         1:
  242.           type: send message
  243.           data:
  244.            - player
  245.             - '&fAnd now, the toggle has been toggled to &atrue &f!'
  246.            
  247.       # Perform if toggle is currently true for the player when he typed the command
  248.       perform_toggle_true:
  249.         1:
  250.           type: send message
  251.           data:
  252.            - player
  253.             - '&fAnd now, the toggle has been toggled to &cfalse &f!'
Advertisement
Add Comment
Please, Sign In to add comment