How do I set a /kill command on a block?

How do I set a /kill command on a block? - Set of red dice stacked together on wooden table placed on sunny terrace in daylight

You can set a /kill command on a command block, I know that, but how do I do it? I am making a map, so please help!



Best Answer

This is pretty lacking in detail, so I'll give you an overview.

First off, you need a command block (Directly from the wiki):

Command blocks can be obtained by using the pick block control or with various commands, such as /give <player> minecraft:command_block <amount>.

Command blocks are not available in the creative inventory, cannot be broken in survival mode or if you do not have operator permissions (1.9[upcoming]), are not flammable, and have the same blast resistance as bedrock. Command blocks cannot be moved by a piston.

Then enter your desired kill command into the command block, e.g.

  • /kill Name where "Name" is a players name, will kill that player
  • /kill @e To kill everything
  • /kill @e[type=Sheep] To kill all sheep
  • /kill @e[type=!Player] Will kill anything which isn't a player (Including de-spawning dropped items)

You then activate the command block in a normal way, the easiest of which is either directly from a switch/lever, or a redstone current.




Pictures about "How do I set a /kill command on a block?"

How do I set a /kill command on a block? - Diligent black female worker setting signboard outside cafeteria at sunny day
How do I set a /kill command on a block? - Top view of scissors against coil of twine and textiles with wooden block tied with threads on desk
How do I set a /kill command on a block? - Unrecognizable child playing jenga at home



Quick Answer about "How do I set a /kill command on a block?"

  • To kill the player executing the command: kill @s.
  • To kill the player Steve: kill Steve.
  • To kill item entities: kill @e[type=item]
  • To kill all entities within 10 blocks: ...
  • To kill all entities except players: kill @e[type=!player]
  • To kill all creepers within 10 blocks:


  • How do you make a command block kill everything?

    Kill Command In all Minecraft editions, the command for killing everything in the world is \u201c /kill <target> \u201d. Typing \u201c /kill \u201d any target in the console will destroy pretty much everything that can be removed, including the player.

    How do you execute a command at a block?

    How to get a Command Block
  • Enable cheats in your world or Realm settings.
  • Turn on Creative Mode in your world or Realm settings.
  • Open the chat box and enter \u201c/give [your username] command_block\u201d
  • Place the block where you want it.


  • How do you use the kill entity command?

    Typing just /kill will kill every entity in a loaded area, including your armor, stands, minecarts, and even your own player. To prevent killing your own player, make sure to limit the command from killing yourself as well. For example, /kill @e[type=! player] will kill every entity except for your own player.



    Using Commands in Minecraft: /kill and an Introduction to Position Selectors | 1.11.2




    More answers regarding how do I set a /kill command on a block?

    Answer 2

    You can't exactly /kill a block (at least I don't think), as blocks are notentities. However there are some exceptions including Item Frames and Minecarts. What you can do as an alternative is /setblock x y z air for example, to set a block to air (basically removing it completely).

    With Item Frames, you can do /kill @e[type=ItemFrame]. Same with minecarts (just making the ItemFrame into a MinecartRidable

    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Matthias Groeneveld, Ketut Subiyanto, Teona Swift, Ketut Subiyanto