I want to prevent my friends from using the commands /give and /gamemode, however I wish to allow them to use commands such as /tp. How could I prevent them from using these commands, without turning the allow cheats option off?

  • What have you tried/considered so far? What you want is impossible without mods or huge command conditions (maybe just mods). But maybe there's a smaller, more specific usecase that is doable; Is there some possible restriction? For example do you only have a fixed number of commands they are supposed to use, like teleporting to someone else? They could be bound to triggers. – Fabian Röling Jan 5 at 14:28
  • Thank your response,greatly appreciated. Do you know how to do it with mod? – user224973 Jan 5 at 15:10
  • This is probably a stupid question but are people also not allowed to drop or take items? When one uses the give command, the item they summoned is executable for a single tick, so you could execute all the items to kill players. You could also tag items that you want players to pick up and then execute the items that don't have that tag. -_('')_/- – SpiceWeasel Jan 5 at 15:51
  • @user224973 You would either have to find one (I think I heard of one with advanced commands permissions), in that case Google is your friend, or you would have to write one, which is very hard. – Fabian Röling Jan 5 at 19:05

I have solved the TP problem by creating command blocks that when activated return players to a central "teleportation" hub. Then, from the hub, they can teleport back to any of the teleportation stations.

I suspect judicious use of command blocks should enable any other limited command use your players desire.


There is no way (for as far as I know) to check what people type in chat. There was [/testfor] source command but that was removed from the game and wouldn't exactly give you what you want.

One way I could think of would be to check for players in a certain gamemode :


Deal damage to the players in that gamemode :

/effect @e[type=Player] 1 7 1 true

/kill @player

Set that player back to the previous gamemode :

/gamemode 2 @a

/deop @a

The obvious drawback being that people who are allowed to be in said gamemode will also be instantly killed and de-opped.

You could (when testfor still worked) use :

/testfor @p[r=5,name=<PlayerName>]

To exclude people from the above command, thus keeping people who are allowed to be op from suffering the server wrath but i'm not sure if there is a way to still get this to work.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.