From d607e022400ba1736c69b8bb611fd8b20b7005a4 Mon Sep 17 00:00:00 2001 From: sovde Date: Tue, 8 Mar 2022 17:43:47 -0500 Subject: [PATCH 01/17] Initial commit of the command tutorial I'm not fully satisfied with how it looks, and will probably do a second pass. I am happy with the content, though, and would like feedback if possible. I also haven't done anything about navigation, which will be needed for jumping between tutorials. --- docs/tutorials.html | 255 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 242 insertions(+), 13 deletions(-) diff --git a/docs/tutorials.html b/docs/tutorials.html index d4e74bb75c6..e685e63dffa 100644 --- a/docs/tutorials.html +++ b/docs/tutorials.html @@ -1,16 +1,245 @@ +

Tutorials

-

Note:

-
- Skript Tutorials are coming soon. -

-
    -
  1. Loops
  2. -
  3. Commands
  4. -
  5. Functions
  6. -
  7. Variables
  8. -
  9. Visual effects
  10. -
+ + + +

Custom Commands

+

+ Skript allows you to easily create custom commands in your scripts, like the following: +

+
+ # A simple `broadcast` command for broadcasting the text argument.
+ # This is accessible only to users with the `skript.example.broadcast` permission.

+
+ command /broadcast <text>:
+     permission: skript.example.broadcast
+     description: Broadcasts a message to everybody.
+     trigger:
+         broadcast arg-text
+
+

+ That's a simple example, but you can do much more complex things with custom commands! + That "/broadcast" command only shows a few of the options you have available when creating a custom command. +

+ + + +

Command Pattern

+

+ Here's the full list of features that you can use in your commands. They're all optional, except for the trigger section. We'll explain each one individually below. +

+
+ command /<command name> <arguments>:
+     aliases: +             # alternate command names
+     executable by: +       # players or console
+     usage: +               # the message that explains how to use the command
+     description: +         # the command's description
+     permission: +          # the permissions needed to use the command
+     permission message: +  # the message sent to users without the correct permissions
+     cooldown: +            # a timespan, during which the command can't be used again
+     cooldown message: +    # the message sent when the command is used again too fast
+     cooldown bypass: +     # the permission necessary to bypass the cooldown
+     cooldown storage: +    # what variable to store the cooldown in
+     trigger:
+         # The code to run goes here. +

+ + + + +

Command Name

+

+ The command name is what comes immediately after command. It can consist of any characters you want, except for space. Additionally, the / in front of the command is optional. This means + command /broadcast and command broadcast are the same. Here are a few examples: +

+
+ command /test-command:
+     trigger:
+         broadcast "Command: /test-command"

-
-
\ No newline at end of file + command nickname:
+     trigger:
+         broadcast "Command: /nickname"
+
+ command //set!:
+     trigger:
+         broadcast "Command: //set!"
+
+ + + + +

Arguments

+

+ Arguments follow the command name, and are separated by spaces. Arguments can be any text you'd like.
You can make arguments optional by surrounding them with brackets, like this: command /kill [all entities]. +
However, the real power in arguments comes from type arguments. These allow a command to take in a type, like command /kill <player>. The player argument can now be + referenced in the trigger section by arg-1 or argument 1 or a number of other ways. You can also name type variables like so: <name:type>, which can then be refenced as a local variable: {_name}. Here's the full pattern for arguments: +

+
+ <name:type=%default value%> +
+

+ Arguments can be used in a lot of different ways, so I'll provide some examples ranging from the simplest possible to more complex uses. +

+
+ # this command can be run by "/test" or by "/test command".
+ command /test [command]:
+     trigger:
+         broadcast "Command: /test or /test command"
+
+ # broadcasts the name of the given player. "of" is optional.
+ command /name [of] <player>:
+     trigger:
+         broadcast "Player's name: %arg-1%, %argument 1%, or %player-argument%"
+
+ # heals the player in the argument. If no player is given, it will heal the sender.
+ command /heal [<player=%player%>]:
+     trigger:
+         heal %argument 1%
+
+ + # this can be used like /kill zombies, /kill creepers and animals in radius 100 or /kill monsters in the radius 6.
# the radius will default to 20 if isn't entered.

+ command /kill <entity types> [in [the] radius <number = 20>]:
+     trigger:
+         loop entities in radius arg-2 of player:
+             if loop-entity is arg-1:
+                 kill loop-entity
+
+ # sends the text given in the command. If no text is given, it will broadcast the default value of "default text".
+ # note that the text is referenced as {_text input}, rather than arg-1 or similar.

+ command /broadcast [<text input:text="default text">]:
+     trigger:
+         broadcast {_text input}
+ +
+ + + +

Aliases

+

+ Aliases are alternate names for your command. For example, the command /teleport could have an alias /tp. Like in the command name, the / is optional. +

+
+ # this command can be run by "/teleport" or by "/tp".
+ command /teleport <number> <number> <number>:
+     aliases: tp
+     trigger:
+         teleport player to location(arg-1, arg-2, arg-3)
+
+ + + +

Executable by

+

+ Who can execute this command. The options are players, console, or players and console. +

+
+ command /shutdown:
+     executable by: console
+     trigger:
+         shutdown the server
+
+ + + +

Executable by

+

+ What/who can execute this command. The options are players, console, or players and console. +

+
+ command /shutdown:
+     executable by: console
+     trigger:
+         shutdown the server
+
+ + + +

Description

+

+ The description of the command. Other plugins can get/show this, but it's not used by much, so I'll skip the example for this one. +

+ + + +

Permissions

+

+ The permissions required to execute this command. The message sent to players without the proper permissions can be customized with the permission message: field. +

+
+ command /shutdown:
+     permission: server.admin
+     permission message: Only admins can shut down the server!
+     trigger:
+         shutdown the server
+
+ + + +

Cooldowns

+

+ This field takes a timespan that the player must wait out before executing the command again. The cooldown can be canceled with cancel the cooldown (documentation here). + Like with the permissions, you can change the default cooldown message with the cooldown message: field. The remaining time of the cooldown can be displayed with %remaining time% Additionally, you can store the cooldown in a variable with cooldown storage:, in order to store the cooldown even when the server restarts. +

+
+ command /vote:
+     cooldown: 1 day
+     cooldown message: You can only vote once a day!
+     cooldown storage: {vote::cooldown::%player%}
+     trigger:
+         add 1 to {vote::%player%}
+
+ + + +

The Trigger Section

+

+ This section is where all the code the command should run is located. I'm sure you're familiar with how it works from the previous examples, but in case you're still unsure, some more examples of commands will be displayed here. You can see these example commands and more in the scripts/-examples/commands.sk file in your server. +

+
+ command /item <items>:
+     description: Give yourself some items.
+     usage: /item
+     aliases: /i
+     executable by: players
+     permission: skript.example.item
+     cooldown: 30 seconds
+     cooldown message: You need to wait %remaining time% to use this command again.
+     cooldown bypass: skript.example.cooldown
+     trigger:
+         if player has permission "skript.example.item.all":
+             give arguments to player
+         else:
+             loop arguments:
+                 if (TNT, bedrock, obsidian, mob spawner, lava, lava bucket) does not contain loop-item :
+                     give loop-item to player
+                 else:
+                     send "%loop-item% is blacklisted and cannot be spawned." to player +
+ + +

Note:

+
+ Other Skript tutorials are coming soon. +

+
    +
  1. Loops
  2. +
  3. Functions
  4. +
  5. Variables
  6. +
  7. Visual effects
  8. +
+
+
+ + \ No newline at end of file From 1b10ed823658b1a0a343b7b55866bd1edc6865eb Mon Sep 17 00:00:00 2001 From: sovde Date: Wed, 9 Mar 2022 08:06:49 -0500 Subject: [PATCH 02/17] Remove duplicate section --- docs/tutorials.html | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/docs/tutorials.html b/docs/tutorials.html index e685e63dffa..48d82981240 100644 --- a/docs/tutorials.html +++ b/docs/tutorials.html @@ -153,19 +153,6 @@

Executable by

-

Executable by

-

- What/who can execute this command. The options are players, console, or players and console. -

-
- command /shutdown:
-     executable by: console
-     trigger:
-         shutdown the server
-
- - -

Description

The description of the command. Other plugins can get/show this, but it's not used by much, so I'll skip the example for this one. From a0a09d3cfe20d6d5a8e280fdcef69ef08a49663d Mon Sep 17 00:00:00 2001 From: sovde Date: Wed, 9 Mar 2022 10:03:20 -0500 Subject: [PATCH 03/17] Moved to commands.html and removed highlight,js --- docs/commands.html | 222 ++++++++++++++++++++++++++++++++++++++++++++ docs/tutorials.html | 215 ------------------------------------------ 2 files changed, 222 insertions(+), 215 deletions(-) create mode 100644 docs/commands.html diff --git a/docs/commands.html b/docs/commands.html new file mode 100644 index 00000000000..6e95cd83ec1 --- /dev/null +++ b/docs/commands.html @@ -0,0 +1,222 @@ + Skript Documentation - 2.6 + +

Custom Commands

+ +
+

Custom Commands in Skript

+

+ Skript allows you to easily create custom commands in your scripts, like the following: +

+
+ # A simple `broadcast` command for broadcasting the text argument.
+ # This is accessible only to users with the `skript.example.broadcast` permission.
+
+ command /broadcast <text>:
+     permission: skript.example.broadcast
+     description: Broadcasts a message to everybody.
+     trigger:
+         broadcast arg-text
+
+

+ That's a simple example, but you can do much more complex things with custom commands! + That "/broadcast" command only shows a few of the options you have available when creating a custom command. +

+ + + +

Command Pattern

+

+ Here's the full list of features that you can use in your commands. They're all optional, except for the trigger section. We'll explain each one individually below. +

+
+ command /<command name> <arguments>:
+     aliases: +             # alternate command names
+     executable by: +       # players or console
+     usage: +               # the message that explains how to use the command
+     description: +         # the command's description
+     permission: +          # the permissions needed to use the command
+     permission message: +  # the message sent to users without the correct permissions
+     cooldown: +            # a timespan, during which the command can't be used again
+     cooldown message: +    # the message sent when the command is used again too fast
+     cooldown bypass: +     # the permission necessary to bypass the cooldown
+     cooldown storage: +    # what variable to store the cooldown in
+     trigger:
+         # The code to run goes here. +

+ + + + +

Command Name

+

+ The command name is what comes immediately after command. It can consist of any characters you want, except for space. Additionally, the / in front of the command is optional. This means + command /broadcast and command broadcast are the same. Here are a few examples: +

+
+ command /test-command:
+     trigger:
+         broadcast "Command: /test-command"
+
+ command nickname:
+     trigger:
+         broadcast "Command: /nickname"
+
+ command //set!:
+     trigger:
+         broadcast "Command: //set!"
+
+ + + + +

Arguments

+

+ Arguments follow the command name, and are separated by spaces. Arguments can be any text you'd like.
You can make arguments optional by surrounding them with brackets, like this: command /kill [all entities]. +
However, the real power in arguments comes from type arguments. These allow a command to take in a type, like command /kill <player>. The player argument can now be + referenced in the trigger section by arg-1 or argument 1 or a number of other ways. You can also name type variables like so: <name:type>, which can then be refenced as a local variable: {_name}. Here's the full pattern for arguments: +

+
+ <name:type=%default value%> +
+

+ Arguments can be used in a lot of different ways, so I'll provide some examples ranging from the simplest possible to more complex uses. +

+
+ # this command can be run by "/test" or by "/test command".
+ command /test [command]:
+     trigger:
+         broadcast "Command: /test or /test command"
+
+ # broadcasts the name of the given player. "of" is optional.
+ command /name [of] <player>:
+     trigger:
+         broadcast "Player's name: %arg-1%, %argument 1%, or %player-argument%"
+
+ # heals the player in the argument. If no player is given, it will heal the sender.
+ command /heal [<player=%player%>]:
+     trigger:
+         heal %argument 1%
+
+ + # this can be used like /kill zombies, /kill creepers and animals in radius 100 or /kill monsters in the radius 6.
# the radius will default to 20 if isn't entered.
+ command /kill <entity types> [in [the] radius <number = 20>]:
+     trigger:
+         loop entities in radius arg-2 of player:
+             if loop-entity is arg-1:
+                 kill loop-entity
+
+ # sends the text given in the command. If no text is given, it will broadcast the default value of "default text".
+ # note that the text is referenced as {_text input}, rather than arg-1 or similar.
+ command /broadcast [<text input:text="default text">]:
+     trigger:
+         broadcast {_text input}
+ +
+ + + +

Aliases

+

+ Aliases are alternate names for your command. For example, the command /teleport could have an alias /tp. Like in the command name, the / is optional. +

+
+ # this command can be run by "/teleport" or by "/tp".
+ command /teleport <number> <number> <number>:
+     aliases: tp
+     trigger:
+         teleport player to location(arg-1, arg-2, arg-3)
+
+ + + +

Executable by

+

+ Who can execute this command. The options are players, console, or players and console. +

+
+ command /shutdown:
+     executable by: console
+     trigger:
+         shutdown the server
+
+ + + +

Description

+

+ The description of the command. Other plugins can get/show this, but it's not used by much, so I'll skip the example for this one. +

+ + + +

Permissions

+

+ The permissions required to execute this command. The message sent to players without the proper permissions can be customized with the permission message: field. +

+
+ command /shutdown:
+     permission: server.admin
+     permission message: Only admins can shut down the server!
+     trigger:
+         shutdown the server
+
+ + + +

Cooldowns

+

+ This field takes a timespan that the player must wait out before executing the command again. The cooldown can be canceled with cancel the cooldown (documentation here). + Like with the permissions, you can change the default cooldown message with the cooldown message: field. The remaining time of the cooldown can be displayed with %remaining time% Additionally, you can store the cooldown in a variable with cooldown storage:, in order to store the cooldown even when the server restarts. +

+
+ command /vote:
+     cooldown: 1 day
+     cooldown message: You can only vote once a day!
+     cooldown storage: {vote::cooldown::%player%}
+     trigger:
+         add 1 to {vote::%player%}
+
+ + + +

The Trigger Section

+

+ This section is where all the code the command should run is located. I'm sure you're familiar with how it works from the previous examples, but in case you're still unsure, some more examples of commands will be displayed here. You can see these example commands and more in the scripts/-examples/commands.sk file in your server. +

+
+ command /item <items>:
+     description: Give yourself some items.
+     usage: /item
+     aliases: /i
+     executable by: players
+     permission: skript.example.item
+     cooldown: 30 seconds
+     cooldown message: You need to wait %remaining time% to use this command again.
+     cooldown bypass: skript.example.cooldown
+     trigger:
+         if player has permission "skript.example.item.all":
+             give arguments to player
+         else:
+             loop arguments:
+                 if (TNT, bedrock, obsidian, mob spawner, lava, lava bucket) does not contain loop-item :
+                     give loop-item to player
+                 else:
+                     send "%loop-item% is blacklisted and cannot be spawned." to player +
+ +

+ Guide written by sovde. +

+
+
+ \ No newline at end of file diff --git a/docs/tutorials.html b/docs/tutorials.html index 48d82981240..97afd4ba33e 100644 --- a/docs/tutorials.html +++ b/docs/tutorials.html @@ -1,221 +1,6 @@

Tutorials

- - - -

Custom Commands

-

- Skript allows you to easily create custom commands in your scripts, like the following: -

-
- # A simple `broadcast` command for broadcasting the text argument.
- # This is accessible only to users with the `skript.example.broadcast` permission.

-
- command /broadcast <text>:
-     permission: skript.example.broadcast
-     description: Broadcasts a message to everybody.
-     trigger:
-         broadcast arg-text
-
-

- That's a simple example, but you can do much more complex things with custom commands! - That "/broadcast" command only shows a few of the options you have available when creating a custom command. -

- - - -

Command Pattern

-

- Here's the full list of features that you can use in your commands. They're all optional, except for the trigger section. We'll explain each one individually below. -

-
- command /<command name> <arguments>:
-     aliases: -             # alternate command names
-     executable by: -       # players or console
-     usage: -               # the message that explains how to use the command
-     description: -         # the command's description
-     permission: -          # the permissions needed to use the command
-     permission message: -  # the message sent to users without the correct permissions
-     cooldown: -            # a timespan, during which the command can't be used again
-     cooldown message: -    # the message sent when the command is used again too fast
-     cooldown bypass: -     # the permission necessary to bypass the cooldown
-     cooldown storage: -    # what variable to store the cooldown in
-     trigger:
-         # The code to run goes here. -

- - - - -

Command Name

-

- The command name is what comes immediately after command. It can consist of any characters you want, except for space. Additionally, the / in front of the command is optional. This means - command /broadcast and command broadcast are the same. Here are a few examples: -

-
- command /test-command:
-     trigger:
-         broadcast "Command: /test-command"
-
- command nickname:
-     trigger:
-         broadcast "Command: /nickname"
-
- command //set!:
-     trigger:
-         broadcast "Command: //set!"
-
- - - - -

Arguments

-

- Arguments follow the command name, and are separated by spaces. Arguments can be any text you'd like.
You can make arguments optional by surrounding them with brackets, like this: command /kill [all entities]. -
However, the real power in arguments comes from type arguments. These allow a command to take in a type, like command /kill <player>. The player argument can now be - referenced in the trigger section by arg-1 or argument 1 or a number of other ways. You can also name type variables like so: <name:type>, which can then be refenced as a local variable: {_name}. Here's the full pattern for arguments: -

-
- <name:type=%default value%> -
-

- Arguments can be used in a lot of different ways, so I'll provide some examples ranging from the simplest possible to more complex uses. -

-
- # this command can be run by "/test" or by "/test command".
- command /test [command]:
-     trigger:
-         broadcast "Command: /test or /test command"
-
- # broadcasts the name of the given player. "of" is optional.
- command /name [of] <player>:
-     trigger:
-         broadcast "Player's name: %arg-1%, %argument 1%, or %player-argument%"
-
- # heals the player in the argument. If no player is given, it will heal the sender.
- command /heal [<player=%player%>]:
-     trigger:
-         heal %argument 1%
-
- - # this can be used like /kill zombies, /kill creepers and animals in radius 100 or /kill monsters in the radius 6.
# the radius will default to 20 if isn't entered.

- command /kill <entity types> [in [the] radius <number = 20>]:
-     trigger:
-         loop entities in radius arg-2 of player:
-             if loop-entity is arg-1:
-                 kill loop-entity
-
- # sends the text given in the command. If no text is given, it will broadcast the default value of "default text".
- # note that the text is referenced as {_text input}, rather than arg-1 or similar.

- command /broadcast [<text input:text="default text">]:
-     trigger:
-         broadcast {_text input}
- -
- - - -

Aliases

-

- Aliases are alternate names for your command. For example, the command /teleport could have an alias /tp. Like in the command name, the / is optional. -

-
- # this command can be run by "/teleport" or by "/tp".
- command /teleport <number> <number> <number>:
-     aliases: tp
-     trigger:
-         teleport player to location(arg-1, arg-2, arg-3)
-
- - - -

Executable by

-

- Who can execute this command. The options are players, console, or players and console. -

-
- command /shutdown:
-     executable by: console
-     trigger:
-         shutdown the server
-
- - - -

Description

-

- The description of the command. Other plugins can get/show this, but it's not used by much, so I'll skip the example for this one. -

- - - -

Permissions

-

- The permissions required to execute this command. The message sent to players without the proper permissions can be customized with the permission message: field. -

-
- command /shutdown:
-     permission: server.admin
-     permission message: Only admins can shut down the server!
-     trigger:
-         shutdown the server
-
- - - -

Cooldowns

-

- This field takes a timespan that the player must wait out before executing the command again. The cooldown can be canceled with cancel the cooldown (documentation here). - Like with the permissions, you can change the default cooldown message with the cooldown message: field. The remaining time of the cooldown can be displayed with %remaining time% Additionally, you can store the cooldown in a variable with cooldown storage:, in order to store the cooldown even when the server restarts. -

-
- command /vote:
-     cooldown: 1 day
-     cooldown message: You can only vote once a day!
-     cooldown storage: {vote::cooldown::%player%}
-     trigger:
-         add 1 to {vote::%player%}
-
- - - -

The Trigger Section

-

- This section is where all the code the command should run is located. I'm sure you're familiar with how it works from the previous examples, but in case you're still unsure, some more examples of commands will be displayed here. You can see these example commands and more in the scripts/-examples/commands.sk file in your server. -

-
- command /item <items>:
-     description: Give yourself some items.
-     usage: /item
-     aliases: /i
-     executable by: players
-     permission: skript.example.item
-     cooldown: 30 seconds
-     cooldown message: You need to wait %remaining time% to use this command again.
-     cooldown bypass: skript.example.cooldown
-     trigger:
-         if player has permission "skript.example.item.all":
-             give arguments to player
-         else:
-             loop arguments:
-                 if (TNT, bedrock, obsidian, mob spawner, lava, lava bucket) does not contain loop-item :
-                     give loop-item to player
-                 else:
-                     send "%loop-item% is blacklisted and cannot be spawned." to player -
- -

Note:

Other Skript tutorials are coming soon. From c8223f35e1e57bb8c63534ce947c07ba2efe3818 Mon Sep 17 00:00:00 2001 From: sovde Date: Wed, 9 Mar 2022 10:05:03 -0500 Subject: [PATCH 04/17] Update commands.html missed one --- docs/commands.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/commands.html b/docs/commands.html index 6e95cd83ec1..e0613cb6422 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -86,7 +86,7 @@

Arguments

referenced in the trigger section by arg-1 or argument 1 or a number of other ways. You can also name type variables like so: <name:type>, which can then be refenced as a local variable: {_name}. Here's the full pattern for arguments:

- <name:type=%default value%> + <name:type=%default value%>

Arguments can be used in a lot of different ways, so I'll provide some examples ranging from the simplest possible to more complex uses. From 6fd1cfe0d8616f536a19051b984b7e338c7fd035 Mon Sep 17 00:00:00 2001 From: sovde Date: Wed, 9 Mar 2022 10:12:23 -0500 Subject: [PATCH 05/17] Update tutorials.html --- docs/tutorials.html | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/docs/tutorials.html b/docs/tutorials.html index 97afd4ba33e..d4e74bb75c6 100644 --- a/docs/tutorials.html +++ b/docs/tutorials.html @@ -1,17 +1,16 @@ -

Tutorials

-

Note:

-
- Other Skript tutorials are coming soon. -

-
    -
  1. Loops
  2. -
  3. Functions
  4. -
  5. Variables
  6. -
  7. Visual effects
  8. -
-
-
-
- \ No newline at end of file +

Note:

+
+ Skript Tutorials are coming soon. +

+
    +
  1. Loops
  2. +
  3. Commands
  4. +
  5. Functions
  6. +
  7. Variables
  8. +
  9. Visual effects
  10. +
+
+
+
\ No newline at end of file From b8ade25fa39d65e7643987c5689f7282c77e2975 Mon Sep 17 00:00:00 2001 From: sovde Date: Wed, 9 Mar 2022 10:21:21 -0500 Subject: [PATCH 06/17] Removed header/body tags from commands.html I should really look over everything first instead of making like 4 commits --- docs/commands.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/commands.html b/docs/commands.html index e0613cb6422..e274836a263 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -1,5 +1,3 @@ - Skript Documentation - 2.6 -

Custom Commands

@@ -218,5 +216,4 @@

The Trigger Section

Guide written by sovde.

-
- \ No newline at end of file +
\ No newline at end of file From c4a60f2ad5dd64f1aaa2b18f9e36ac14ab0a9af2 Mon Sep 17 00:00:00 2001 From: sovde Date: Fri, 11 Mar 2022 23:26:26 -0500 Subject: [PATCH 07/17] add one more example from the rewritten command examples --- docs/commands.html | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/commands.html b/docs/commands.html index e274836a263..0e271c855cb 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -206,11 +206,38 @@

The Trigger Section

            give arguments to player
        else:
            loop arguments:
-                 if (TNT, bedrock, obsidian, mob spawner, lava, lava bucket) does not contain loop-item :
+                 if (TNT, bedrock, obsidian, mob spawner, lava, lava bucket) does not contain loop-item:
                    give loop-item to player
                else:
                    send "%loop-item% is blacklisted and cannot be spawned." to player +
+
+ command /home <text> [<text>]:
+     description: Set, delete or travel to your home.
+     usage: /home set/remove <name>, /home <name>
+     permission: skript.example.home
+     executable by: players
+     trigger:
+         if arg-1 is "set":
+             if arg-2 is set:
+                 set {homes::%uuid of player%::%arg-2%} to player's location
+                 send "Set your home <green>%arg-2%<reset> to <grey>%location of player%<reset>" to player
+             else:
+                 send "You must specify a name for this home." to player
+         else if arg-1 is "remove":
+             if arg-2 is set:
+                 delete {homes::%uuid of player%::%arg-2%}
+                 send "Deleted your home <green>%arg-2%<reset>" to player
+             else:
+                 send "You must specify the name of this home." to player
+         else if arg-2 is set:
+             send "Correct usage: /home set/remove <name>" to player
+         else if {homes::%uuid of player%::%arg-1%} is set:
+             teleport player to {homes::%uuid of player%::%arg-1%}
+         else:
+             send "You have no home named <green>%arg-1%<reset>." to player +

Guide written by sovde. From 3ab1bffb56b6a6aa6d45c73aff6ab5825babfaeb Mon Sep 17 00:00:00 2001 From: sovde Date: Sun, 13 Mar 2022 16:08:28 -0400 Subject: [PATCH 08/17] applying suggestions from review Waiting on response from blueyescat for permission to use snippets from their tutorial, so this PR shouldn't be accepted until that happens. --- docs/commands.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/commands.html b/docs/commands.html index 0e271c855cb..925f815a9bf 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -79,9 +79,9 @@

Command Name

Arguments

- Arguments follow the command name, and are separated by spaces. Arguments can be any text you'd like.
You can make arguments optional by surrounding them with brackets, like this: command /kill [all entities]. -
However, the real power in arguments comes from type arguments. These allow a command to take in a type, like command /kill <player>. The player argument can now be - referenced in the trigger section by arg-1 or argument 1 or a number of other ways. You can also name type variables like so: <name:type>, which can then be refenced as a local variable: {_name}. Here's the full pattern for arguments: + Arguments follow the command name, and are separated by spaces. Arguments can be any text you'd like.
You can make arguments optional by surrounding them with brackets, like this: command /kill [all entities]. +
However, the real power in arguments comes from type arguments. These allow a command to take in a type, like command /kill <player>. The player argument can now be + referenced in the trigger section by arg-1 or argument 1 or a number of other ways. You can also name type variables like so: <name:type>, which can then be refenced as a local variable: {_name}. Here's the full pattern for arguments:

<name:type=%default value%> @@ -152,7 +152,7 @@

Executable by

Description

- The description of the command. Other plugins can get/show this, but it's not used by much, so I'll skip the example for this one. + The description of the command. Other plugins can get/show this like /help or /help teleport.

@@ -173,7 +173,7 @@

Permissions

Cooldowns

- This field takes a timespan that the player must wait out before executing the command again. The cooldown can be canceled with cancel the cooldown (documentation here). + This field takes a timespan that the player must wait out before executing the command again. The cooldown can be canceled with cancel the cooldown (documentation here). Like with the permissions, you can change the default cooldown message with the cooldown message: field. The remaining time of the cooldown can be displayed with %remaining time% Additionally, you can store the cooldown in a variable with cooldown storage:, in order to store the cooldown even when the server restarts.

@@ -240,7 +240,7 @@

The Trigger Section

- Guide written by sovde. + Guide written by sovde, with parts used from blueyescat's tutorial on skripthub.

\ No newline at end of file From 7596a3baa18dba34e610fed30636927c507443fb Mon Sep 17 00:00:00 2001 From: sovde Date: Thu, 17 Mar 2022 19:07:27 -0400 Subject: [PATCH 09/17] Permission gained --- docs/commands.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/commands.html b/docs/commands.html index 925f815a9bf..b357447d433 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -240,7 +240,7 @@

The Trigger Section

- Guide written by sovde, with parts used from blueyescat's tutorial on skripthub. + Guide written by sovde, with parts used with permission from blueyescat's tutorial on skripthub.

- \ No newline at end of file + From 69a814a8e09cad37f71f7cdae09df095c3d14e5d Mon Sep 17 00:00:00 2001 From: sovdeeth Date: Fri, 18 Mar 2022 20:39:00 -0400 Subject: [PATCH 10/17] Apply suggestions from code review Co-authored-by: Ayham Al Ali --- docs/commands.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/commands.html b/docs/commands.html index b357447d433..cd599507e58 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -6,12 +6,12 @@

Custom Commands in Skript

Skript allows you to easily create custom commands in your scripts, like the following:

- # A simple `broadcast` command for broadcasting the text argument.
- # This is accessible only to users with the `skript.example.broadcast` permission.
+ # A simple "broadcast" command for broadcasting the text argument.
+ # This is accessible only to users with the "skript.example.broadcast" permission.

command /broadcast <text>:
    permission: skript.example.broadcast
-     description: Broadcasts a message to everybody.
+     description: Broadcasts a message to everyone including console.
    trigger:
        broadcast arg-text
@@ -79,7 +79,7 @@

Command Name

Arguments

- Arguments follow the command name, and are separated by spaces. Arguments can be any text you'd like.
You can make arguments optional by surrounding them with brackets, like this: command /kill [all entities]. + Arguments follow the command name, and are separated by spaces.
You can make arguments optional by surrounding them with square brackets [], like this: command /kill [all entities].
However, the real power in arguments comes from type arguments. These allow a command to take in a type, like command /kill <player>. The player argument can now be referenced in the trigger section by arg-1 or argument 1 or a number of other ways. You can also name type variables like so: <name:type>, which can then be refenced as a local variable: {_name}. Here's the full pattern for arguments:

@@ -103,7 +103,7 @@

Arguments

# heals the player in the argument. If no player is given, it will heal the sender.
command /heal [<player=%player%>]:
    trigger:
-         heal %argument 1%
+         heal argument 1

# this can be used like /kill zombies, /kill creepers and animals in radius 100 or /kill monsters in the radius 6.
# the radius will default to 20 if isn't entered.
@@ -125,7 +125,7 @@

Arguments

Aliases

- Aliases are alternate names for your command. For example, the command /teleport could have an alias /tp. Like in the command name, the / is optional. + Aliases are alternate names for your command. For example, the command /teleport could have an alias /tp. Like in the command name, the forward slash (/) is optional.

# this command can be run by "/teleport" or by "/tp".
@@ -180,16 +180,16 @@

Cooldowns

command /vote:
    cooldown: 1 day
    cooldown message: You can only vote once a day!
-     cooldown storage: {vote::cooldown::%player%}
+     cooldown storage: {vote::cooldown::%uuid of player%}
    trigger:
-         add 1 to {vote::%player%}
+         add 1 to {vote::players::%uuid of player%}

The Trigger Section

- This section is where all the code the command should run is located. I'm sure you're familiar with how it works from the previous examples, but in case you're still unsure, some more examples of commands will be displayed here. You can see these example commands and more in the scripts/-examples/commands.sk file in your server. + This section is where all the code the command should run is located. I'm sure you're familiar with how it works from the previous examples, but in case you're still unsure, some more examples of commands will be displayed here. You can see these example commands and more in the /plugins/Skript/scripts/-examples/commands.sk file in your server.

command /item <items>:
@@ -200,7 +200,7 @@

The Trigger Section

    permission: skript.example.item
    cooldown: 30 seconds
    cooldown message: You need to wait %remaining time% to use this command again.
-     cooldown bypass: skript.example.cooldown
+     cooldown bypass: skript.example.cooldown.bypass
    trigger:
        if player has permission "skript.example.item.all":
            give arguments to player
@@ -214,7 +214,7 @@

The Trigger Section


command /home <text> [<text>]:
-     description: Set, delete or travel to your home.
+     description: Set, delete or teleport to your home.
    usage: /home set/remove <name>, /home <name>
    permission: skript.example.home
    executable by: players
From 44eae02e9bea8adea8bb34d5edc5b7f644a09506 Mon Sep 17 00:00:00 2001 From: sovde Date: Fri, 18 Mar 2022 20:50:21 -0400 Subject: [PATCH 11/17] Update commands.html --- docs/commands.html | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/docs/commands.html b/docs/commands.html index cd599507e58..86c76390ee8 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -20,8 +20,6 @@

Custom Commands in Skript

That "/broadcast" command only shows a few of the options you have available when creating a custom command.

- -

Command Pattern

Here's the full list of features that you can use in your commands. They're all optional, except for the trigger section. We'll explain each one individually below. @@ -52,9 +50,6 @@

Command Pattern

        # The code to run goes here.

- - -

Command Name

The command name is what comes immediately after command. It can consist of any characters you want, except for space. Additionally, the / in front of the command is optional. This means @@ -74,14 +69,11 @@

Command Name

        broadcast "Command: //set!"
- - -

Arguments

Arguments follow the command name, and are separated by spaces.
You can make arguments optional by surrounding them with square brackets [], like this: command /kill [all entities]. -
However, the real power in arguments comes from type arguments. These allow a command to take in a type, like command /kill <player>. The player argument can now be - referenced in the trigger section by arg-1 or argument 1 or a number of other ways. You can also name type variables like so: <name:type>, which can then be refenced as a local variable: {_name}. Here's the full pattern for arguments: +
However, the real power in arguments comes from type arguments. These allow a command to take in a type, like command /kill <player>. Type arguments must be surrounded by angle brackets <> and can also be made optional by surrounding them with square brackets: [<player>]. +
The argument can then be referenced in the trigger section by arg-1 or argument 1 or a number of other ways. You can also name type variables like so: <name:type>, which can then be refenced as a local variable: {_name}. Here's the full pattern for arguments:

<name:type=%default value%> @@ -121,8 +113,6 @@

Arguments

- -

Aliases

Aliases are alternate names for your command. For example, the command /teleport could have an alias /tp. Like in the command name, the forward slash (/) is optional. @@ -135,8 +125,6 @@

Aliases

        teleport player to location(arg-1, arg-2, arg-3)
- -

Executable by

Who can execute this command. The options are players, console, or players and console. @@ -148,15 +136,11 @@

Executable by

        shutdown the server
- -

Description

The description of the command. Other plugins can get/show this like /help or /help teleport.

- -

Permissions

The permissions required to execute this command. The message sent to players without the proper permissions can be customized with the permission message: field. @@ -169,8 +153,6 @@

Permissions

        shutdown the server
- -

Cooldowns

This field takes a timespan that the player must wait out before executing the command again. The cooldown can be canceled with cancel the cooldown (documentation here). @@ -185,8 +167,6 @@

Cooldowns

        add 1 to {vote::players::%uuid of player%}
- -

The Trigger Section

This section is where all the code the command should run is located. I'm sure you're familiar with how it works from the previous examples, but in case you're still unsure, some more examples of commands will be displayed here. You can see these example commands and more in the /plugins/Skript/scripts/-examples/commands.sk file in your server. From ce921a149383feb18260dc17d342aa5662cdefa8 Mon Sep 17 00:00:00 2001 From: sovde Date: Sun, 20 Mar 2022 19:27:55 -0400 Subject: [PATCH 12/17] Reorganizing and adding "exec by" stuff --- docs/commands.html | 27 +++++++++++++++------------ src/test/skript/tests/misc/vectors.sk | 27 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 src/test/skript/tests/misc/vectors.sk diff --git a/docs/commands.html b/docs/commands.html index 86c76390ee8..c2515bd28f3 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -90,7 +90,7 @@

Arguments

# broadcasts the name of the given player. "of" is optional.
command /name [of] <player>:
    trigger:
-         broadcast "Player's name: %arg-1%, %argument 1%, or %player-argument%"
+         send "Player's name: %arg-1%, %argument 1%, or %player-argument%" to player # here 'player' refers to the player executing the command

# heals the player in the argument. If no player is given, it will heal the sender.
command /heal [<player=%player%>]:
@@ -100,6 +100,7 @@

Arguments

# this can be used like /kill zombies, /kill creepers and animals in radius 100 or /kill monsters in the radius 6.
# the radius will default to 20 if isn't entered.
command /kill <entity types> [in [the] radius <number = 20>]:
+     executable by: players # this will be explained later on
    trigger:
        loop entities in radius arg-2 of player:
            if loop-entity is arg-1:
@@ -113,27 +114,28 @@

Arguments

-

Aliases

+

Executable by

- Aliases are alternate names for your command. For example, the command /teleport could have an alias /tp. Like in the command name, the forward slash (/) is optional. + Who can execute this command. The options are players, console, or players and console.

- # this command can be run by "/teleport" or by "/tp".
- command /teleport <number> <number> <number>:
-     aliases: tp
+ command /shutdown:
+     executable by: console
    trigger:
-         teleport player to location(arg-1, arg-2, arg-3)
+         shutdown the server
-

Executable by

+

Aliases

- Who can execute this command. The options are players, console, or players and console. + Aliases are alternate names for your command. For example, the command /teleport could have an alias /tp. Like in the command name, the forward slash (/) is optional.

- command /shutdown:
-     executable by: console
+ # this command can be run by "/teleport" or by "/tp".
+ command /teleport <number> <number> <number>:
+     executable by: players
+     aliases: tp
    trigger:
-         shutdown the server
+         teleport player to location(arg-1, arg-2, arg-3)

Description

@@ -160,6 +162,7 @@

Cooldowns

command /vote:
+     executable by: players
    cooldown: 1 day
    cooldown message: You can only vote once a day!
    cooldown storage: {vote::cooldown::%uuid of player%}
diff --git a/src/test/skript/tests/misc/vectors.sk b/src/test/skript/tests/misc/vectors.sk new file mode 100644 index 00000000000..c8880017c6d --- /dev/null +++ b/src/test/skript/tests/misc/vectors.sk @@ -0,0 +1,27 @@ +test "manipulateVector": + set {_vector} to vector(3, 0, 0) + assert length of {_vector} = 3 with "vector length should have been 3" + assert yaw of {_vector} = 270 with "vector yaw should have been 270" + assert pitch of {_vector} = 0 with "vector pitch should have been 0" + + assert x component of {_vector} = 3 with "vector x component should have been 3" + assert y component of {_vector} = 0 with "vector y component should have been 0" + assert z component of {_vector} = 0 with "vector z component should have been 0" + + add 135 to yaw of {_vector} + assert length of {_vector} = 3 with "vector length should have been 3" + assert yaw of {_vector} = 45 with "vector yaw should have been 45" + assert pitch of {_vector} = 0 with "vector pitch should have been 0" + + assert x component of {_vector} = -0.7071 with "vector x component should have been -0.7071" + assert y component of {_vector} = 0 with "vector y component should have been 0" + assert z component of {_vector} = 0.7071 with "vector z component should have been 0.7071" + + add 45 to pitch of {_vector} + assert length of {_vector} = 3 with "vector length should have been 3" + assert yaw of {_vector} = 45 with "vector yaw should have been 45" + assert pitch of {_vector} = 45 with "vector pitch should have been 45" + + assert x component of {_vector} = -0.5 with "vector x component should have been -0.5" + assert y component of {_vector} = -0.7071 with "vector y component should have been -0.7071" + assert z component of {_vector} = 0.5 with "vector z component should have been 0.5" \ No newline at end of file From 4a6edb3f01489fb7061d3bff6acac6f632f496d0 Mon Sep 17 00:00:00 2001 From: sovde Date: Mon, 21 Mar 2022 16:07:54 -0400 Subject: [PATCH 13/17] accidentally added a test file in here somehow --- src/test/skript/tests/misc/vectors.sk | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/test/skript/tests/misc/vectors.sk diff --git a/src/test/skript/tests/misc/vectors.sk b/src/test/skript/tests/misc/vectors.sk deleted file mode 100644 index c8880017c6d..00000000000 --- a/src/test/skript/tests/misc/vectors.sk +++ /dev/null @@ -1,27 +0,0 @@ -test "manipulateVector": - set {_vector} to vector(3, 0, 0) - assert length of {_vector} = 3 with "vector length should have been 3" - assert yaw of {_vector} = 270 with "vector yaw should have been 270" - assert pitch of {_vector} = 0 with "vector pitch should have been 0" - - assert x component of {_vector} = 3 with "vector x component should have been 3" - assert y component of {_vector} = 0 with "vector y component should have been 0" - assert z component of {_vector} = 0 with "vector z component should have been 0" - - add 135 to yaw of {_vector} - assert length of {_vector} = 3 with "vector length should have been 3" - assert yaw of {_vector} = 45 with "vector yaw should have been 45" - assert pitch of {_vector} = 0 with "vector pitch should have been 0" - - assert x component of {_vector} = -0.7071 with "vector x component should have been -0.7071" - assert y component of {_vector} = 0 with "vector y component should have been 0" - assert z component of {_vector} = 0.7071 with "vector z component should have been 0.7071" - - add 45 to pitch of {_vector} - assert length of {_vector} = 3 with "vector length should have been 3" - assert yaw of {_vector} = 45 with "vector yaw should have been 45" - assert pitch of {_vector} = 45 with "vector pitch should have been 45" - - assert x component of {_vector} = -0.5 with "vector x component should have been -0.5" - assert y component of {_vector} = -0.7071 with "vector y component should have been -0.7071" - assert z component of {_vector} = 0.5 with "vector z component should have been 0.5" \ No newline at end of file From a6d242ebccefe9e750bc55369041a8d12cc3b54d Mon Sep 17 00:00:00 2001 From: sovdee Date: Fri, 15 Jul 2022 15:09:55 -0700 Subject: [PATCH 14/17] Apply simple changes from code review Co-authored-by: APickledWalrus --- docs/commands.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/commands.html b/docs/commands.html index c2515bd28f3..6e9f38f7464 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -41,7 +41,7 @@

Command Pattern

    cooldown:            # a timespan, during which the command can't be used again
    cooldown message: -    # the message sent when the command is used again too fast
+    # the message sent when the command is used before the cooldown is over
    cooldown bypass:     # the permission necessary to bypass the cooldown
    cooldown storage: @@ -52,7 +52,7 @@

Command Pattern

Command Name

- The command name is what comes immediately after command. It can consist of any characters you want, except for space. Additionally, the / in front of the command is optional. This means + The command name is what comes immediately after command. It can consist of any characters you want, except for whitespace characters. Additionally, the forward slash (/) in front of the command is optional. This means command /broadcast and command broadcast are the same. Here are a few examples:

@@ -114,7 +114,7 @@

Arguments

-

Executable by

+

Executable By

Who can execute this command. The options are players, console, or players and console.

From 81d2141814f88ca9178fc94b5a16437c27a6736c Mon Sep 17 00:00:00 2001 From: sovde Date: Fri, 15 Jul 2022 17:54:22 -0700 Subject: [PATCH 15/17] Cooldown Expressions --- docs/commands.html | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/commands.html b/docs/commands.html index 6e9f38f7464..5fcf377164c 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -35,7 +35,7 @@

Command Pattern

    description:         # the command's description
    permission: -          # the permissions needed to use the command
+          # the permission needed to use the command
    permission message:  # the message sent to users without the correct permissions
    cooldown: @@ -158,7 +158,8 @@

Permissions

Cooldowns

This field takes a timespan that the player must wait out before executing the command again. The cooldown can be canceled with cancel the cooldown (documentation here). - Like with the permissions, you can change the default cooldown message with the cooldown message: field. The remaining time of the cooldown can be displayed with %remaining time% Additionally, you can store the cooldown in a variable with cooldown storage:, in order to store the cooldown even when the server restarts. + Like with the permissions, you can change the default cooldown message with the cooldown message: field. Additionally, you can store the cooldown in a variable with cooldown storage:, in order to store the cooldown even when the server restarts. + You can also set up a permission that allows players to bypass the cooldown with bypass cooldown permission:.

command /vote:
@@ -166,6 +167,23 @@

Cooldowns

    cooldown: 1 day
    cooldown message: You can only vote once a day!
    cooldown storage: {vote::cooldown::%uuid of player%}
+     cooldown bypass: vote.cooldown.bypass
+     trigger:
+         add 1 to {vote::players::%uuid of player%}
+
+

+ There are also a number of expressions you can use to interact with the cooldowns of commands. You can get the remaining time with remaining time, the elapsed time with elapsed time, and the total time with cooldown time. You can also get the bypass permission with bypass permission.
+ If you've enabled keep command last usage dates in your config.sk file, you can get the last time the player used the command with last usage date.
+ You can see the full syntax for these expressions here. +

+
+ # The same vote command but with an improved cooldown message.
+ command /vote:
+     executable by: players
+     cooldown: 1 day
+     cooldown message: You can only vote once a day! You last voted at %last usage%, and it's only been %elapsed time%. Please wait another %remaining time%.
+     cooldown storage: {vote::cooldown::%uuid of player%}
+     cooldown bypass: vote.cooldown.bypass
    trigger:
        add 1 to {vote::players::%uuid of player%}
@@ -223,7 +241,7 @@

The Trigger Section

- Guide written by sovde, with parts used with permission from blueyescat's tutorial on skripthub. + Guide written by sovde, with parts used with permission from blueyescat's tutorial on SkriptHub.

From d1f223c0620947fc21baf3d9718406fd2c75ff6b Mon Sep 17 00:00:00 2001 From: sovde Date: Fri, 15 Jul 2022 17:58:41 -0700 Subject: [PATCH 16/17] Missed a few "permissions" --- docs/commands.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/commands.html b/docs/commands.html index 5fcf377164c..83188b895d6 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -37,7 +37,7 @@

Command Pattern

    permission:          # the permission needed to use the command
    permission message: -  # the message sent to users without the correct permissions
+  # the message sent to users without the correct permission
    cooldown:            # a timespan, during which the command can't be used again
    cooldown message: @@ -143,9 +143,9 @@

Description

The description of the command. Other plugins can get/show this like /help or /help teleport.

-

Permissions

+

Permission

- The permissions required to execute this command. The message sent to players without the proper permissions can be customized with the permission message: field. + The permission required to execute this command. The message sent to players without the proper permission can be customized with the permission message: field.

command /shutdown:
@@ -158,7 +158,7 @@

Permissions

Cooldowns

This field takes a timespan that the player must wait out before executing the command again. The cooldown can be canceled with cancel the cooldown (documentation here). - Like with the permissions, you can change the default cooldown message with the cooldown message: field. Additionally, you can store the cooldown in a variable with cooldown storage:, in order to store the cooldown even when the server restarts. + Like with the permission, you can change the default cooldown message with the cooldown message: field. Additionally, you can store the cooldown in a variable with cooldown storage:, in order to store the cooldown even when the server restarts. You can also set up a permission that allows players to bypass the cooldown with bypass cooldown permission:.

From 0f21b05bc2b432f49e42dd164e25fc5ba63b1703 Mon Sep 17 00:00:00 2001 From: sovde Date: Thu, 28 Jul 2022 19:42:35 -0700 Subject: [PATCH 17/17] Useful use case of optional arguments Added example of how to use optional arguments like distinct flags (think command line argument flags) --- docs/commands.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/commands.html b/docs/commands.html index 83188b895d6..3c77e26e443 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -97,7 +97,6 @@

Arguments

    trigger:
        heal argument 1

- # this can be used like /kill zombies, /kill creepers and animals in radius 100 or /kill monsters in the radius 6.
# the radius will default to 20 if isn't entered.
command /kill <entity types> [in [the] radius <number = 20>]:
    executable by: players # this will be explained later on
@@ -111,7 +110,23 @@

Arguments

command /broadcast [<text input:text="default text">]:
    trigger:
        broadcast {_text input}
- +
+ # Using optional commands as flags that don't have to all be used
+ # eg:
+ # /give-item stone sword with name Sword in the Stone and with lore Haha, get it?
+ # or
+ # /give-item heart of the sea with lore &bA murky blue orb.
+ command /give-item [with name ] [[and] with lore ]:
+     trigger:
+         set {_item} to arg-1
+         # set name
+         if arg-2 is set:
+             set name of {_item} to formatted arg-2
+         # set lore
+         if arg-3 is set:
+             set lore of {_item} to formatted arg-3
+         # give item
+         give player {_item}

Executable By