Skip to content
Skip to content
ブログに戻る
Minecraftの/kills @e[type=!player]完全ガイド

Minecraftの/kills @e[type=!player]完全ガイド

Alexandru Maftei
Alexandru Maftei
@ice
Updated
3 閲覧
TL;DR:/kill @e[type=!player]は、プレイヤー以外の全エンティティを即刻削除します。サーバーのクリーニングやラグ管理に必須ですが、チートを有効にする必要があり、重要なエンティティを消さないように注意が必要です。

The command /kill @e[type=!player] kills every entity in your world except players. It's a one-line solution for clearing out all those accumulated mobs, items, and chaos when your server's getting laggy or you just want a fresh start.

What This Command Does

Let's break it down. /kill @e[type=!player] targets all entities (@e means "all entities") and excludes players with that [type=!player] selector. When you run it, everything dies instantly. Mobs, animals, dropped items, minecarts, armor stands, experience orbs, all of it. The only things left standing are you and any other players logged in.

The beauty of this command is the simplicity. You're not targeting specific biomes or dimensions. You're not filtering by health or age. It's just: "kill every non-player thing right now." One command, instant results.

When You'd Need This

I've used this on my SMP when things got out of hand. We had about five hundred cows from a failed farm automation attempt, and my frames were tanking. One command solved it. Took the server from unplayable to smooth instantly.

Other scenarios where this helps:

  • Lag spikes from accumulated mobs during mob farm testing
  • Clearing items left behind after a wipe or reset
  • Removing tons of armor stands from a build after you're done with them
  • Cleaning up after a TNT explosion experiment goes way too far (speaking from experience here)
  • Preparing a server for a new season

The real use case is server management. On a multiplayer server, admin cleanup is constant. This command cuts cleanup time from hours to milliseconds. If you're running any kind of public server, you'll reach for this eventually.

How to Use It

First, you need cheats enabled. In singleplayer, create your world with cheats on. On servers, set enable-command-block in your server.properties to true, or just run it with op privileges. Then press T to open chat, type the command exactly as shown, and hit enter.

/kill @e[type=!player]

That's it. Everything except players dies instantly. So it affects the entire loaded world simultaneously. Here's the thing, if you're worried you missed something in the command syntax, test it in a creative world first. Copy-paste it directly and you won't have typos.

One thing to watch: this is immediate. There's no confirmation, no countdown, no mercy. You run it and it happens. If you accidentally targeted the wrong thing, you can't undo it (unless you've got a backup, which you should always have anyway).

Variations and What They Do Differently

Want to kill only mobs and keep animals alive? Use /kill @e[type=!player,type=!cow,type=!sheep] and keep adding entity types you want to protect. This gets unwieldy fast with multiple exceptions, but it works.

Kill only dropped items? /kill @e[type=item] clears your ground clutter without touching any living creatures. Useful after a big build cleanup.

Only hostile mobs? That's trickier. There's no "hostile" tag you can filter by in vanilla Minecraft, so you'd need to list each one: /kill @e[type=zombie,type=creeper,type=skeleton] etc. Gets long fast. And this is where mods or datapacks become your friend if you're doing it constantly.

Kill entities in a specific radius? /kill @e[type=!player,distance=..50] kills everything that isn't a player within 50 blocks of you. You can swap out that distance number.

The Danger Zone: What Can Go Wrong

This command is powerful. That means it can mess things up badly if misused. It'll delete all your item frames with maps, all your armor stands from your builds, every rideable entity, all your shulkers you were using for storage (okay, shulkers survive, but the point stands). I've watched builders lose hours of work because someone ran this on a server without thinking about the consequences.

If you're on a multiplayer server, restrict this to admins only. Use permission plugins to make sure random players can't nuke your entire server's entities with one chat message. It's not complicated to lock down, but it matters.

One more thing: this doesn't reset the world. Your terrain stays. Your builds stay. You're only removing living things and items. So if someone built a gigantic mob farm that's lagging the server, this clears the mobs but not the farm structure itself, which might still be a problem depending on what's causing the lag.

Worth Running or Overkill?

Honestly? It's essential for any server operator. Keep this command bookmarked or memorized. The second your server starts choking from entity spam, you'll want this instant access. On singleplayer, you can get by without it since you can just cull mobs manually, but it still saves time.

If you're testing server performance or running diagnostics on lag, you might also check out our free Minecraft DNS tool to see if network factors are affecting your connection alongside entity counts. And if you're managing a multiplayer server and need to test connectivity, the Minecraft Votifier tester can help you verify your server's communication setup.

The command's worth knowing even if you never use it. Server management comes up faster than you'd expect.

About the author
Alexandru Maftei
Alexandru MafteiLead Writer

Lead writer at minecraft.how. Long-time Minecraft player running a small SMP server, testing every build, mod, and seed before writing about it.

Share with your friends!

Comments

No comments yet. Be the first to share your thoughts!

We use cookies to improve your experience. By continuing to use this site, you agree to our use of cookies. Read our Privacy Policy