Skip to content

First Menu

This page shows the smallest useful menu flow: define a menu, open it for a player, and keep the runtime concepts simple.

  • you already have a working DaisyCore bootstrap
  • you are comfortable with the command flow from First Command

You will create a simple profile menu that opens from your /profile command.

val profileMenu =
menu("Profile", rows = 3) {
slot(13) {
item(Material.PLAYER_HEAD) {
name = "Your Profile"
}
onClick {
player.sendMessage("Profile clicked.")
}
}
}
command("profile") {
executePlayer {
player.openMenu(profileMenu)
}
}

The DaisyMenu value is the static menu definition. When a player opens it, DaisyCore creates a DaisyMenuSession for that player. That session holds runtime state like rendering and refresh lifecycle.

You usually care about the definition first. DaisyCore handles the session ownership under the hood.

Current behavior

Menu definitions stay reusable while runtime state stays session-specific. That separation is one of the main reasons DaisyCore menus stay clean in plugin code.

  • menu definitions are meant to stay reusable
  • per-player runtime state lives in sessions
  • DaisyCore cleans up sessions when the platform shuts down