Guides

How to See and Count Entities in Minecraft

Show the entity count with F3 (since 1.21.9 via F3 + F6), hitboxes with F3 + B, count mobs with /execute, check the mob cap and see a whole server live.

In short

In Java Edition, the debug screen (F3) shows the entity count: the line E: 23/180 means 23 entities in your field of view out of 180 loaded ones. Since Minecraft 1.21.9 this line is off by default. Turn it on with F3 + F6. On top of that:

  • F3 + B shows the hitboxes of all entities around you.
  • /execute if entity @e[type=minecraft:zombie] counts all loaded zombies.
  • /effect give @e[type=minecraft:zombie,distance=..64] minecraft:glowing 60 makes them glow through walls.

For a whole server with a map and statistics in the browser I built minecraft-entity-view, but only for Minecraft 1.21.8.

What counts as an entity?

Entities are everything in the world that is not a block: mobs and animals, players, dropped items, experience orbs, arrows, boats, minecarts, armor stands and item frames. Many entities in a small area cost performance, so it pays to look at them, for example around mob farms or when the game suddenly starts to lag.

In the debug screen (F3)

Up to Minecraft 1.21.8 the line sits directly on the left side of the F3 screen:

E: 23/180, B: 0, SD: 12
  • The first number is the entities being rendered, i.e. in your field of view.
  • The second number is all entities in the loaded area around you.
  • SD is the simulation distance in chunks.

Since Minecraft 1.21.9 the debug screen has been rebuilt, and every line can be switched on its own:

  1. Press F3 + F6 to open the debug options.
  2. Set the entry entity_render_stats from "OFF" to "In F3" (called "In Overlay" in newer versions), or to "Always" to see the line without F3 as well.
  3. Do the same with entity_spawn_counts for the mob cap numbers (see below).

Note

If the game rule reduced_debug_info is active on a server, the game hides part of the debug information, including the mob cap numbers and the hitboxes.

Show hitboxes

F3 + B draws a box around every entity, including items and arrows. That way you quickly find where things pile up, as long as they are within sight. Press F3 + B again to turn the boxes off.

Count entities of one type

With cheats (in singleplayer) or operator rights (on a server), /execute counts all matching entities in the loaded area and reports the number in chat:

/execute if entity @e[type=minecraft:zombie]
/execute if entity @e[type=minecraft:item]
/execute if entity @e[type=minecraft:zombie,distance=..64]

The first line counts all zombies, the second all dropped items, the third only zombies within 64 blocks. Entities in chunks that are not loaded are not counted.

See entities through walls

The Glowing effect draws an outline around entities that is visible through blocks:

/effect give @e[type=minecraft:zombie,distance=..64] minecraft:glowing 60

All zombies within 64 blocks now glow for 60 seconds. Any other mob works instead of zombie, and without type= every mob nearby glows. Items, boats or minecarts stay dark: effects only work on living entities.

Check the mob cap

Minecraft limits how many mobs of a category may spawn naturally around the players. For a single player that is, for example, 70 monsters, 10 animals and 15 bats. Once the limit is reached, nothing else spawns. That is often why a mob farm suddenly stays empty: monsters hanging around somewhere else fill up the limit.

How many mobs count right now is shown by the entity_spawn_counts line in the debug screen, e.g. SC: 289, M: 52, C: 7, A: 3, …. SC is the loaded chunks where mobs can spawn, M the monsters, C the animals, A the bats. Only the server knows these numbers, so you can rely on seeing them in singleplayer only.

Vanilla does not let you change the limits themselves. That is why I wrote the NeoForge mod mob-cap-multiplier: /mcm set monster 2 doubles the limit for monsters, /mcm set ambient 0 turns bats off completely, without a restart.

See all entities of a server live

The methods above only show what is loaded around you. For a whole server I wanted to see at a glance where mobs gather, which chunks stay active all the time and which farm produces more items than anyone collects. That is how minecraft-entity-view came about:

  • every entity as an icon on the map of the Overworld, the Nether and the End, plus the state of every loaded chunk
  • the number of entities per category over time and tables with every mob, item and vehicle
  • removing single entities right from the browser, e.g. a forgotten boat

On the server, the mod minecraft-api delivers the data, and optionally squaremap provides the map background. How to set everything up is described under Installation.

Important

minecraft-entity-view, minecraft-api and mob-cap-multiplier run with exactly Minecraft 1.21.8 and NeoForge 21.8.33 or later. I no longer develop them, but the code stays public, and forks are welcome.