NapNodes

← Minecraft guides

Minecraft · updated 4 November 2026

The /dialog Command in Minecraft: Rules on Join and Button Menus for Your Server

Since 1.21.6, Minecraft has its own pop-up windows: a box with a title, text and buttons that the server can open for anyone. With them you show the rules on join, put up a menu with the Discord link or a button to go to spawn, and even add an option to the pause menu. No plugins: the /dialog command and a small data pack. Everything here uses today's Java syntax.

What a dialog is and what you can do with it

A dialog is a screen that opens on top of the game: a title, some text (or an item with its description), sometimes boxes to type in or choose from, and one or more buttons. Each button can open a website, copy some text, run a command, open another dialog or just close.

It only exists in Java, since 1.21.6: older versions have nothing like it without mods or plugins, and Bedrock doesn't have it.

There are five types: notice (a message with a single button), confirmation (yes or no), multi_action (a grid of buttons, the menu), dialog_list (buttons that open other dialogs) and server_links (the links the server sends).

Rather not set it up yourself? Minecraft servers from €6 a month, no contract and a full refund within 72 hours. Or create a free Minecraft server, no card needed.

How it's written

It has two forms: /dialog show <players> <dialog> opens it and /dialog clear <players> closes it. If it works, the game replies “Displayed dialog to Ana” or “Displayed dialog to 5 players”.

You need to be an operator (level 2) or have cheats on in a single-player world. On a server, op yourself from the console with op YourName (the op guide). Players are picked with selectors as usual: @a everyone, @p the nearest, or a name (the selectors guide).

The dialog can be the name of one saved in a data pack (napnodes:rules) or one written inside the command itself, in curly braces. The second is the quick way for a one-off message; the first, for things you repeat.

  1. A message to everyone right now

    /dialog show @a {type:"minecraft:notice",title:"Restart in 5 minutes",body:{type:"minecraft:plain_message",contents:"Save whatever you're working on."}} opens a notice for everyone with its “Ok” button.

  2. The server links

    /dialog show @a minecraft:server_links opens “Server Links”, the dialog that comes with the game showing whatever links the server has sent. A Paper server with no plugins doesn't send any; some plugins do add them.

  3. Closing it

    /dialog clear @a closes whatever dialog they have open.

Rules on join, with a data pack

The most requested one: that whoever joins sees the rules before playing. It takes a data pack with four files. The napnodes folder is the data pack's name: change it to yours, lowercase and with no spaces, everywhere it appears. If you'd rather not write it by hand, the dialog generator gives you this same data pack, and the menu further down, with your rules and your buttons, as a .zip.

The dialog goes in data/napnodes/dialog/rules.json. With can_close_with_escape set to false, it doesn't close with Esc: you have to press “Got it”. A line break inside the text is \n. If you already have your rules written, paste them here (and if not, the server rules guide has three lists to start from).

data/napnodes/dialog/rules.json
{
  "type": "minecraft:notice",
  "title": "Server rules",
  "body": {
    "type": "minecraft:plain_message",
    "contents": "1. Be respectful in chat.\n2. Don't touch what others build.\n3. No cheats or advantage mods.\n\nIf you have a problem, tell an admin."
  },
  "action": { "label": "Got it" },
  "can_close_with_escape": false
}
data/napnodes/function/load.mcfunction
# Runs when the data pack loads: creates the objectives tick uses
scoreboard objectives add nap_leaves minecraft.custom:minecraft.leave_game
scoreboard objectives add nap_wait dummy
scoreboard objectives add rules trigger
data/napnodes/function/tick.mcfunction
# First-time joiners and returning players: wait 2 seconds (40 ticks) for them to load
scoreboard players set @a[tag=!nap_seen] nap_wait 40
tag @a[tag=!nap_seen] add nap_seen
scoreboard players set @a[scores={nap_leaves=1..}] nap_wait 40
scoreboard players reset @a[scores={nap_leaves=1..}] nap_leaves
# When the countdown ends, the rules
dialog show @a[scores={nap_wait=1}] napnodes:rules
scoreboard players remove @a[scores={nap_wait=1..}] nap_wait 1
# /trigger rules: anyone can see them again
scoreboard players enable @a rules
dialog show @a[scores={rules=1..}] napnodes:rules
scoreboard players set @a[scores={rules=1..}] rules 0
data/minecraft/tags/function/load.json
{ "values": ["napnodes:load"] }
data/minecraft/tags/function/tick.json
{ "values": ["napnodes:tick"] }
  1. The pack.mcmeta

    At the root, next to the data folder, goes the pack.mcmeta with your version's format number. For 26.3 it's min_format and max_format at 121; for another version, get it with the pack.mcmeta generator. The two tags/function files are separate, each with its own line.

  2. Zip it

    Make a .zip with pack.mcmeta and the data folder inside, directly, with no other folder above them.

  3. Upload it to datapacks

    To the world's datapacks folder (world/datapacks) and restart the server. How to check it loaded, in the data packs guide.

  4. Test it

    Leave and join again: two seconds later the rules should pop up. If not, /dialog show @s napnodes:rules tells you whether the dialog exists; if it errors saying it can't find it, the file isn't in data/napnodes/dialog/ or has a JSON mistake.

A menu with buttons: Discord, spawn and the IP

multi_action makes a menu: a grid of buttons, two per row unless you say otherwise (columns). It goes in data/napnodes/dialog/menu.json, in the same data pack.

run_command buttons run the command as if the person clicking had typed it, with their permissions: if they're not op, an op command gives them an error. For things anyone should be able to do, the button uses /trigger, which needs no permissions, and the tick function does the rest. Commands that send a signed chat message, like /msg or /say, don't work from a button.

data/napnodes/dialog/menu.json
{
  "type": "minecraft:multi_action",
  "title": "Server menu",
  "columns": 2,
  "actions": [
    { "label": "Rules", "action": { "type": "minecraft:show_dialog", "dialog": "napnodes:rules" } },
    { "label": "Go to spawn", "action": { "type": "minecraft:run_command", "command": "trigger spawn" } },
    { "label": "Our Discord", "action": { "type": "minecraft:open_url", "url": "https://discord.gg/your-invite" } },
    { "label": "Copy the IP", "action": { "type": "minecraft:copy_to_clipboard", "value": "yourserver.play.napnodes.com" } }
  ],
  "exit_action": { "label": "Close" }
}
Add to load.mcfunction and tick.mcfunction
# load.mcfunction
scoreboard objectives add spawn trigger
scoreboard objectives add menu trigger

# tick.mcfunction (change 0 80 0 to your spawn's coordinates)
scoreboard players enable @a spawn
execute in minecraft:overworld run tp @a[scores={spawn=1..}] 0 80 0
scoreboard players set @a[scores={spawn=1..}] spawn 0
scoreboard players enable @a menu
dialog show @a[scores={menu=1..}] napnodes:menu
scoreboard players set @a[scores={menu=1..}] menu 0
  1. Open it with /trigger menu

    Any player types /trigger menu and it pops up. If it replies “You cannot trigger this objective yet”, the tick function isn't running: the data pack hasn't loaded.

  2. Or from a chat message

    /tellraw @a {text:"[Open the menu]",color:"light_purple",click_event:{action:"show_dialog",dialog:"napnodes:menu"}} leaves a message in chat that opens it when clicked. Colours with the tellraw generator.

  3. With the real IP

    Replace yourserver.play.napnodes.com with your server's address, and the Discord link with yours.

In the pause menu and in “Quick Actions”

Two of the game's tags put your dialogs where players find them on their own, without typing anything. They go in data/minecraft/tags/dialog/, in the same data pack.

data/minecraft/tags/dialog/pause_screen_additions.json
{ "values": ["napnodes:menu"] }
  1. pause_screen_additions

    Whatever you list here shows up in the pause menu (Esc) for anyone on your server. With several dialogs, they're grouped under “Custom Options...”. The button's name is the dialog's title, or its external_title if you want a shorter one.

  2. quick_actions

    Same format in quick_actions.json: the dialogs here show up in “Quick Actions”, which opens with its own key. Each player picks it in Options → Controls; tell them it exists, because hardly anyone knows about it.

Boxes to type in and choose from (for admins)

A dialog can ask for input: inputs with text boxes (text), yes-or-no boxes (boolean), pick-one options (single_option) or a slider (number_range). Each has a key, and the button with the dynamic/run_command action puts what was typed into its command with $(key).

For example, an announcement panel for admins: a text box with key text and a button with {"type":"minecraft:dynamic/run_command","template":"title @a title \"$(text)\""} puts whatever you type in big letters on everyone's screen. Since /title is an op command, that button would give a normal player an error: only open it for admins.

Whatever is typed in the box is escaped automatically (quotes included) so it fits inside the command's quotes. Buttons of type custom and dynamic/custom do nothing on a server without plugins: they're there for a plugin to receive.

The usual errors

It can't find the dialog: the name doesn't match the path. napnodes:rules has to be at data/napnodes/dialog/rules.json, with the dialog folder in singular. If the JSON has a mistake, the exact warning shows up in the console at startup.

A command from a video that doesn't work: dialogs are from 1.21.6, and in 1.21.5 the way clickable text is written in commands changed (click_event and url or command, instead of clickEvent and value). This guide uses today's form.

The rules don't show up on join: check with /datapack list that the data pack is enabled and that tick.json has the function's name right. If you're coming from an old data pack, since 1.21 the folders are function and tags/function, in singular.

A button does nothing: if it runs an op command and whoever clicks isn't op, it doesn't run. Switch it to /trigger like the spawn button.

On NapNodes

Minecraft servers run Paper on the latest version, so dialogs work as they are, with or without plugins. From the panel's “Console” you run any /dialog without the slash; the data pack is uploaded in “Files”, to world/datapacks, and loads on restart.

If your friends don't have somewhere to play yet, the free Minecraft server is enough to try it: it starts with “Start” when you're about to join.

Frequently asked questions

How do I show the rules when players join my Minecraft server?

With a notice-type dialog in a data pack and a tick function that opens it for whoever joins with /dialog show. It works in Java since 1.21.6, without plugins.

What does the /dialog command do?

It opens or closes a window with a title, text and buttons: /dialog show <players> <dialog> opens it and /dialog clear <players> closes it. You need to be an operator.

Which version added /dialog?

Java 1.21.6. It doesn't exist in Bedrock.

Can a player who isn't op use a dialog?

They can see it and click its buttons, but the buttons' commands run with their permissions. For things anyone should be able to do, the button uses /trigger.

How do I add a button to my server's pause menu?

With the pause_screen_additions dialog tag in a data pack: data/minecraft/tags/dialog/pause_screen_additions.json with your dialog's name.

How do I open a dialog by clicking a chat message?

With tellraw and a show_dialog click_event: /tellraw @a {text:"[Menu]",click_event:{action:"show_dialog",dialog:"napnodes:menu"}}.

Shall we set it up for you?

Minecraft servers from €6 a month, never oversold: your RAM is yours alone. And if you'd rather start without paying, there's a free Minecraft server, no card needed.

Your server doesn't show up in the game? Check it in a second with “Is my Minecraft server online?”: players, version and MOTD, free. Need a player's UUID for the whitelist or permissions? Look it up here. Handing out enchanted items? Build the command with the /give generator.

Free tool: Minecraft dialog generator. Rules that pop up on join and a menu with buttons (Discord, spawn, copy the IP) for your Minecraft server: the datapack as a .zip, no plugins.

Free tool: /tellraw and /title generator. Messages with colours, bold and click actions in chat or across the screen: the /tellraw or /title command ready to copy.

Free tool: pack.mcmeta generator. The pack.mcmeta for your data pack or resource pack with each version's format number (1.14 to 26.3), plus a checker for yours.

Keep reading

All Minecraft guides, sorted →