First Menu
First Menu
Section titled “First Menu”This page shows the smallest useful menu flow: define a menu, open it for a player, and keep the runtime concepts simple.
What this page assumes
Section titled “What this page assumes”- you already have a working DaisyCore bootstrap
- you are comfortable with the command flow from First Command
What you’ll build
Section titled “What you’ll build”You will create a simple profile menu that opens from your /profile command.
Step 1: define the menu
Section titled “Step 1: define the menu”val profileMenu = menu("Profile", rows = 3) { slot(13) { item(Material.PLAYER_HEAD) { name = "Your Profile" }
onClick { player.sendMessage("Profile clicked.") } } }Step 2: open the menu from a command
Section titled “Step 2: open the menu from a command”command("profile") { executePlayer { player.openMenu(profileMenu) }}What a menu session is
Section titled “What a menu session is”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.
What to keep in mind
Section titled “What to keep in mind”- menu definitions are meant to stay reusable
- per-player runtime state lives in sessions
- DaisyCore cleans up sessions when the platform shuts down
Next steps
Section titled “Next steps”- Add a sidebar beside the menu: First Scoreboard
- Understand sessions better: Menu Sessions
- Jump to API details: Menu DSL