Basic Command Structure
A simple command consists of a command declaration, optional properties, and a trigger section that executes when the command is run.skript.example.broadcast permission can use it.
Command Properties
Commands support several optional properties:Permission node required to use the command
Description shown in help messages
Correct usage message displayed when command is used incorrectly
Alternative versions of the command (e.g.,
/i for /item)Restricts who can run the command:
players, console, or omit for bothTime players must wait between uses
Message shown when command is on cooldown (use
%remaining time%)Permission to bypass the cooldown
Multi-Argument Commands
Commands can accept multiple arguments, with optional arguments in square brackets.- Required first argument (
<text>) - Optional second argument (
[<text>]) - Checking if arguments are set with
if arg-2 is set - Player-only execution
- Usage message for incorrect syntax
Commands with Cooldowns and Aliases
- Command alias (
/ias shorthand for/item) - 30-second cooldown with custom message
- Cooldown bypass permission
- Item blacklist using local aliases
- Permission-based filtering
- Item type arguments that accept Skript aliases
Accessing Arguments
Use these patterns to access command arguments:arg-1,arg-2,arg-3- Individual arguments by positionarg-textorargument- All arguments as a single valuearguments- All arguments as a list
Arguments are 1-indexed, so the first argument is
arg-1, not arg-0.Command Cooldowns
Cooldowns prevent command spam and can be configured per-command:Set
keep command last usage dates: true in config.sk if you need to access the last usage date expression in your scripts.Best Practices
Use Clear Permission Nodes
Use Clear Permission Nodes
Organize permissions hierarchically:
servername.feature.actionExample: skript.example.broadcast, skript.example.item.allProvide Usage Messages
Provide Usage Messages
Always include a usage message to help players understand command syntax:
Validate Input
Validate Input
Check if optional arguments are set before using them:
Use Player UUIDs
Use Player UUIDs
Store player data using UUIDs instead of names to handle name changes:
Related Configuration
See Configuration for command-related settings:case-insensitive commands- Accept commands regardless of casekeep command last usage dates- Persist cooldown data
