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.
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.The server links
/dialog show @a minecraft:server_linksopens “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.Closing it
/dialog clear @acloses 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).
{
"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
}# 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# 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{ "values": ["napnodes:load"] }{ "values": ["napnodes:tick"] }The pack.mcmeta
At the root, next to the
datafolder, goes thepack.mcmetawith your version's format number. For 26.3 it'smin_formatandmax_formatat 121; for another version, get it with the pack.mcmeta generator. The twotags/functionfiles are separate, each with its own line.Zip it
Make a .zip with
pack.mcmetaand thedatafolder inside, directly, with no other folder above them.Upload it to datapacks
To the world's
datapacksfolder (world/datapacks) and restart the server. How to check it loaded, in the data packs guide.Test it
Leave and join again: two seconds later the rules should pop up. If not,
/dialog show @s napnodes:rulestells you whether the dialog exists; if it errors saying it can't find it, the file isn't indata/napnodes/dialog/or has a JSON mistake.
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
- The /clone Command in Minecraft: Copy, Move and Duplicate Builds
How to use /clone in Minecraft Java: copy or move a build, without the air, between dimensions, how to rotate it and the block limit and overlap errors.
- The /bossbar Command in Minecraft: Your Own Bars for Events and Countdowns
How to use /bossbar in Minecraft Java: create your own boss bar, change its color, style and value, show it to players, countdowns and common errors.
- Minecraft /transfer Command: Move Players Between Servers Without BungeeCord
How to use /transfer in Minecraft Java to send players to another server: accepts-transfers, the port, a lobby with /trigger and what doesn't travel with them.