Bukkit-specific annotations are distributed in a separate artifact,Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ProjectUnified/CraftCommand/llms.txt
Use this file to discover all available pages before exploring further.
craftcommand-bukkit-annotations, under the package io.github.projectunified.craftcommand.bukkit.annotation. This artifact is intentionally decoupled from the core annotations so that projects targeting other platforms (Standalone, Paper) are not forced to depend on Bukkit APIs. Like all CraftCommand annotations, these carry RetentionPolicy.CLASS and are consumed entirely at compile time.
Add the artifact to your Maven <dependencies> block:
@Permission
Target:TYPE (class), METHOD
Retention: CLASS
Declares the Bukkit permission node that a command sender must hold before the command or subcommand is executed. The generated wrapper calls sender.hasPermission(value) before performing any argument resolution. If the check fails, the sender receives the message (or a platform default message when message is "") and execution stops immediately.
The fully-qualified Bukkit permission node, e.g.
"myplugin.teleport" or "myplugin.admin.kick".The error message sent to the player when they lack the required permission. If left as the default empty string
"", the platform’s default “you do not have permission” message is used instead. Defaults to "".Behavior
| Placement | Effect |
|---|---|
On the class (@Target TYPE) | The permission check applies to every subcommand and the default handler inside that class. |
On a method (@Target METHOD) | The permission check applies only to that specific subcommand handler, allowing finer-grained overrides. |
Examples
Class-level permission — all subcommands requiremyplugin.teleport:
@Permission is only processed by craftcommand-bukkit-processor and craftcommand-paper-processor. If you compile against the Standalone processor (craftcommand-processor), the annotation is present in the class file but silently ignored — no permission check will be generated and no compilation error will occur.