Creating Custom Commands
Complete guide to creating custom commands with zAPI's command framework. Learn how to create commands, subcommands, and parameters without plugin.yml with automatic tab completion and cooldown suppor
Table of Contents
Overview
Key Features
Basic Commands
Creating a Simple Command
Registering the Command
Command Properties
Required Methods
Method
Return Type
Description
Optional Methods
Method
Return Type
Default
Description
Complete Command Example
SubCommands
Creating a SubCommand
Registering SubCommands
SubCommand Structure
Nested SubCommands
Parameters
Creating a Parameter
Registering Parameters
Using Parameters
Parameters with Arguments
Accessing Parameter Values
Parameter Properties
Method
Return Type
Default
Description
Parameter Features
Stop SubCommand Execution
Permission-Based Parameters
Tab Completion
Automatic Tab Completion
Custom Tab Completion
Tab Completion for SubCommands
Tab Completion for Parameters
Parameter Tab Completion
Cooldown System
Basic Cooldown
Bypass Permission
Cooldown Message
How Cooldowns Work
Cooldown Storage
Complete Examples
Example 1: Homes Plugin Command Structure
Example 2: Admin Command with Nested Structure
Example 3: Economy Command with Parameters
Best Practices
Common Patterns
Pattern 1: Confirmation Commands
Pattern 2: Player Target Commands
Pattern 3: Help Subcommand
See Also
Last updated
Was this helpful?
