I've lately been wondering if it was possible to make a sword (or other weapons) that bans the player being hit from the server permanently. I tried searching it on Google, with a few different phrases, but to no avail. I found nothing. It seems no one else in the history of ever wants to know. Is there a chain of command blocks I could write, or some mod I could install for my server?

  • Well, technically your answer is "yes", but only by abusing a critical bug that I will not mention here. – Fabian Röling Aug 2 '19 at 5:44


The /ban comamnd, which would be used to ban people on a server, cannot be used in command blocks or any other means of automatically running commands.

You can, however, use command blocks to emulate the effect of banning a player, see How can I block people from my Minecraft world? for details.

| improve this answer | |
  • Can the Ban command be used by mods? – Nzall Aug 2 '19 at 10:35
  • Presumably one could write a mod to do this, however if the question were asking for a mod if would be off-topic as a software recommendation, so I answered vanilla-only. – pppery Aug 2 '19 at 14:21

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.