Skip to main content
← All Guides
Plugin Development · 5 min read

How to Make a Custom Command with Skript

Learn how to create a custom command in Minecraft using Skript. Step-by-step guide covering syntax, arguments, permissions and cooldowns for Paper 1.21+ servers.

Why Custom Commands Matter

Every Minecraft server needs commands that go beyond what vanilla offers. Whether it is a /spawn shortcut, a custom teleport system, or a staff-only moderation tool, commands are the primary interface between players and server logic. With Skript you can build a fully functional skript custom command minecraft setup in minutes, no Java compiler required.

If you are brand new to Skript itself, start with our Minecraft Skript Tutorial to get the plugin installed and understand the basics. This guide assumes Skript 2.9+ is already running on your Paper 1.21+ server.

Basic Command Syntax

Every Skript custom command starts with a command block. Here is the simplest possible example:

command /heal:
    permission: server.heal
    permission message: &cYou do not have permission to heal.
    trigger:
        heal player
        send "&aYou have been healed!" to player

Save this in a file like plugins/Skript/scripts/heal.sk and run /skript reload heal in-game. That is it, you now have a working /heal command with a permission node.

Breaking Down the Structure

  • command /heal:, declares the command name. The slash is optional in the definition but players will type /heal.
  • permission:, the permission node required. Tie this into LuckPerms for group-based access.
  • permission message:, the error shown when a player lacks the permission.
  • trigger:, the block of code that runs when the command executes.

Adding Arguments

Most useful commands accept arguments. Skript uses angle-bracket placeholders to define them:

command /kit <text>:
    permission: server.kit
    usage: /kit <name>
    trigger:
        if arg-1 is "starter":
            give player 16 cooked beef
            give player iron sword
            give player iron pickaxe
            send "&aYou received the starter kit!" to player
        else if arg-1 is "pvp":
            give player diamond sword
            give player golden apple
            send "&aYou received the PvP kit!" to player
        else:
            send "&cUnknown kit: %arg-1%" to player

Common argument types include <text>, <integer>, <player>, and <number>. The usage: line tells players the correct syntax if they type the command wrong.

Cooldowns

Spammable commands can cause lag or exploit loops. Skript has built-in cooldown support:

command /food:
    cooldown: 5 minutes
    cooldown message: &cYou must wait %remaining time% before using this again.
    trigger:
        give player 32 cooked beef
        send "&aEnjoy your meal!" to player

The %remaining time% placeholder automatically shows how long the player has to wait. Cooldowns persist through script reloads but reset on server restart unless you store them in variables.

Targeting Other Players

Staff commands often need to target other players. Use the <player> argument type for auto-completion and validation:

command /freeze <player>:
    permission: staff.freeze
    trigger:
        if {frozen::%arg-1's uuid%} is true:
            delete {frozen::%arg-1's uuid%}
            send "&aYou have been unfrozen." to arg-1
            send "&aUnfroze %arg-1%." to player
        else:
            set {frozen::%arg-1's uuid%} to true
            send "&cYou have been frozen by a staff member." to arg-1
            send "&aFroze %arg-1%." to player

on move:
    if {frozen::%player's uuid%} is true:
        cancel event

This example combines a skript custom command with an event listener, a pattern you will use constantly when building server features.

Best Practices

  • Always set a permission:, commands without permissions are executable by everyone.
  • Use uuid-based variable keys (like {data::%player's uuid%}) instead of player names, so data survives name changes.
  • Keep one script file per feature. A file called freeze.sk is easier to debug than a 500-line everything.sk.
  • Test with /skript reload <script> instead of restarting the server. It is faster and safer.
  • Use Spark to profile your commands if they run heavy logic, poorly written loops can tank TPS.

Next Steps

Once you are comfortable building a skript custom command, move on to event-based scripting for automated systems. You can also explore Skript vs Java to decide when it is time to graduate to compiled plugins. Custom commands are the foundation of every great Minecraft server, master them and you control the entire player experience.

Need a server to test your plugins on? Astroworld Hosting, full Pterodactyl panel, NVMe SSDs, instant setup.

Related Tools & Resources

🔧

Minecraft Tools

Calculators, generators & server tools

🧱

Item Database

Browse all Minecraft items, stats & recipes

⚒️

Crafting Recipes

Visual crafting guides for every recipe