This question already has an answer here:

I'm running a vanilla minecraft server, and I have some custom commands set up for staff using scoreboard triggers. I want to set up some sort of trigger command that can kick and one that can ban (this one just for admins).

I understand that /kick and /ban won't work from command blocks, though. Is there a workaround for this (especially the kick command) that I could implement for mods and admins?

marked as duplicate by Virusbomb, Wondercricket, greg-449, Joachim, Ivo Coumans Jul 17 at 11:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 5
    Instead of kicking or banning, you could lock a person to a place, or constantly kill them. Those commands are purposely off-limits to command blocks for security reasons. (/op @a anyone? wink wink nudge nudge) – aytimothy Aug 27 '15 at 5:13

One idea would be that you can lock them in a place, for example a jail, then making them unable to break the blocks to escape. A another way would be to constantly kill them or teleport them to a specific location through a redstone clock with attached command blocks. I've had situations like these before, and I would think the first solution is cleaner.

  • I was thinking of maybe using a jail, but there are trigger commands to get a book / tp home or to spawn, and working around that might get messy. I think I'll try maybe teleporting them to a hole just above y=0 where they'll fall out of the world – theBeaks Aug 27 '15 at 6:20

In vanilla Minecraft, there is no way to automate kicks and bans or assign permission levels to the kick and ban command. If you are just looking for permission levels for different commands, you should try seeing if you can host a Bukkit or Spigot server. You can add plug ins such as PermissionsEx. With that, you can manage different player groups (eg: player, mod, admin) and each give them different sets of commands they can use


I found a workaround in trying to figure out how to ban hackers that OP themselves, I set up a fast clock to teleport the offending player in place and execute spam nether portals at their feet (they're suspended in air). This has the effect of trapping them and putting the portal delay on them so they can't issue commands.

Like so:

/tp @a[score_hacker_min=1] -25 2 -8 -90 0 – Red_Mag3 

/execute @a[score_hacker_min=1] ~ ~ ~ setblock -25 2 -8 portal 

This requires a safe zone in the nether as well that does the same, but is 100% effective.

  • /tp @a[score_hacker_min=1] -25 2 -8 -90 0 – Red_Mag3 Jan 4 '16 at 3:53
  • /execute @a[score_hacker_min=1] ~ ~ ~ setblock -25 2 -8 portal – Red_Mag3 Jan 4 '16 at 3:54
  • I've done this for you this time, but you can edit your posts if you need to add additional info :). – Robotnik Jan 4 '16 at 4:16
  • 1.13 syntax: /tp @a[scores={hacker=1..}] -25 2 8 -90 0, /execute if entity @a[scores={hacker=1..}] run setblock -25 2 -8 portal – pppery Jul 16 at 1:12

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