Me and my friends have a private Minecraft server but sometimes 2 of my friends change gamemode to creative or spectator and I don't want that. Does anyone have idea how to prevent that from happening? I can't de-op them because we use /tp command.
1 Answer
You can use a command block on a clock to constantly change the gamemode of players not in survival back into survival mode. Example using 1.9, where the m selector parameter accepts string values (and thus the NOT operator):
/gamemode survival @a[m=!survival]However, keep in mind that this also changes players from adventure mode into survival. If you wanted adventure mode to remain unchanged, you'd need two command blocks to change players out of either creative or spectator mode specifically:
/gamemode survival @a[m=creative]
/gamemode survival @a[m=spectator]For pre-1.9, you'd have to use the second method and numerical IDs, as string values and the NOT operator are not available:
/gamemode survival @a[m=1]
/gamemode survival @a[m=3]