Skip to content

Auto-Loaded Commands

DaisyCore command registration is group-based. You define one or more DaisyCommandGroup objects, annotate them with @DaisyCommandSet, and DaisyCore discovers them when the command subsystem starts.

Right now, DaisyCore does this with a runtime scan of your plugin jar. That keeps setup simple while the command system stabilizes.

@DaisyCommandSet
object IslandCommands : DaisyCommandGroup({
command("island") {
description("Island management")
subcommand("create") {
enabled { plugin.config.getBoolean("commands.island.create") }
player {
replyLang("messages.island.created")
}
}
}
})
override fun onEnable() {
daisy =
DaisyPlatform.create(this) {
commands()
}
}
  • scans your plugin jar for classes annotated with @DaisyCommandSet
  • loads valid DaisyCommandGroup implementations
  • collects their command trees
  • filters disabled roots and subcommands
  • validates root collisions
  • registers the active command set with Paper

Use enabled { ... } when a command should depend on config or plugin state at startup.

command("debug") {
enabled { plugin.config.getBoolean("commands.debug") }
player {
reply("Debug command enabled.")
}
}

Use ignore() as a short way to force a command or subcommand off.

command("oldadmin") {
ignore()
}

The normal path should be clean. You should be able to define commands and let DaisyCore wire them in, instead of maintaining a manual registration list in every project.