Minecraft Java Edition – Display Player Gamemode In-Game Using Commands

minecraft-commandsminecraft-java-edition

I have searched and researched. I do not need to know how to set gamemode.

I would need to display (or list) the gamemode of each player in the game from the command line.

Is that possible? If yes, how?

Best Answer

I have a scoreboard set up to do this:

Base scoreboard command:

/scoreboard objectives add GM dummy Player_Gamemode

Then you set up a redstone clock. This will repeat as often as possible:

(IN COMMAND BLOCKS)

/scoreboard players set @a[m=0] GM 0
/scoreboard players set @a[m=1] GM 1 
/scoreboard players set @a[m=2] GM 2
/scoreboard players set @a[m=3] GM 3

Finally, do:

/scoreboard objectives setdisplay sidebar GM