r/MinecraftCommands • u/kotnkxd • 1h ago
Help | Java 26.2 Is it possible to create a dynamic player list in a dialog using only command blocks? [1.21.11]
I'm trying to create a simple ban menu in my vanilla Minecraft world that opens when I run /trigger banmenu.
The idea is to automatically display a list of all currently online players, with a "Ban" button next to each player's name. Banning a player would simply teleport them to a specific location rather than actually using the /ban command.
The teleportation part isn't a problem. What I can't figure out is how to dynamically retrieve the list of online players and generate dialog buttons for each of them.
I want the player list to update automatically whenever the menu is opened, without having to manually specify player names.
Is this possible using vanilla commands or a datapack, or is it a limitation of the dialog system?
I'm open to any vanilla workarounds.

