Inside HopperBlockEntity: Every 1-Tick Execution Step

Although hoppers transfer only 1 item every 8 game ticks (2.5 items/second = 9,000 items/hour), an idle unlocked hopper does not wait 8 ticks between searches! When a hopper sits idle with cooldownTime == 0, Vanilla Java Edition calls HopperBlockEntity.pushItemsTick() on every single game tick (20 times per second).

Exact Game Formula
MSPT_hoppers = N_unlocked × (T_push + T_containerCheck + I_noContainer × T_itemEntityAABB) + N_locked × T_noop

When powered by redstone (enabled = false), hoppers abort before inventory or entity queries (~92% CPU reduction). When unlocked (enabled = true) with no inventory block above (I_noContainer = 1), Vanilla queries sub-chunk entity tracking lists for ItemEntity hitboxes intersecting [0, 11, 0] → [16, 32, 16] every 1 gt.

Tracing the exact branching order inside HopperBlockEntity reveals why two identical-looking hopper lines can differ in server CPU cost by a factor of ten:

  1. Redstone Lock Gate (BlockState.ENABLED): If the hopper block receives any redstone power (enabled == false), tryMoveItems() is bypassed completely. Only a trivial integer check runs.
  2. Push Phase (ejectItems): If the hopper holds at least 1 item, it attempts to insert into the facing container; if all 5 hopper slots are empty (the normal state of horizontal transport pipes and overflow lines), push exits in nanoseconds.
  3. Pull Phase Step A — Container Lookup (getSourceContainer): If the hopper is not completely full (5 full stacks), it inspects pos.above():
    • If the block above provides a Container or WorldlyContainerHolder (Chest, Barrel, Hopper, Furnace, Dropper, Crafter, or Composter), the hopper iterates that container’s downward-accessible slots and immediately returns without ever scanning for dropped item entities!
    • If no block inventory exists above, AND the block above does not have a full 16×16×16 collision cube (e.g., air, slabs, stairs, soul sand, farmland), Vanilla runs Entity Scan #1: searching pos.above() for CONTAINER_ENTITY_SELECTOR (Chest Minecarts, Hopper Minecarts, Chest Boats).
  4. Pull Phase Step B — Dropped Item Scan (getItemsAtAndAbove): Whenever Step A found zero inventory above, Vanilla runs Entity Scan #2: calling level.getEntitiesOfClass(ItemEntity.class, SUCK_AABB) across the hopper’s suction bounding box (Y + 0.6875 inside the bowl up to Y + 2.0 above the hopper)!
1. Open Air / Slab Above SUCK_AABB 2 Scans/gt! • Minecart Scan: YES • ItemEntity AABB: YES 4,000 Hoppers: +9.85 ms 2. Solid Stone (MYTH!) Stone Block Still Scans! • Minecart Scan: NO • ItemEntity AABB: YES! 4,000 Hoppers: +6.90 ms 3. Composter / Locked Composter 0-Slot Inv • Minecart Scan: NO • ItemEntity AABB: NO Comp: +2.1ms | Lock: +0.76ms
Figure 6: Why full stone blocks fail to optimize Vanilla hoppers. Stone skips the Chest-Minecart check via isCollisionShapeFullBlock(), yet still runs the sub-chunk ItemEntity AABB lookup every tick—whereas an empty Composter bypasses both.

Myth Busted: Solid Blocks vs. Empty Composters

One of the longest-running myths in survival Minecraft claims that placing solid Cobblestone or Glass on top of horizontal hopper pipes stops entity lag because items cannot fall into the hopper. Looking at Step 3 and Step 4 above exposes why that belief is only ~30% true:

  • What a Solid Stone Block Actually Does: Because Stone satisfies isCollisionShapeFullBlock() == true, Vanilla skips Entity Scan #1 (the ChestMinecart check). However, because Stone has no inventory, getSourceContainer() still returns null—so Vanilla immediately executes Entity Scan #2 (ItemEntity AABB intersection) through the solid stone block every single game tick! Worse yet, if players drop gravel, shulker loot, or farm items anywhere inside that same 16×16×16 sub-chunk, every stone-covered hopper iterates over the sub-chunk’s EntitySection item list!
  • Why an Empty Composter (level = 0) Wins Among Caps: In Mojang’s ComposterBlock, implementing WorldlyContainerHolder returns a static singleton EmptyContainer whenever level < 8! That EmptyContainer reports 0 extractable slots (so slot iteration finishes in zero loop cycles!), prevents both Minecart and ItemEntity AABB scans from ever firing, AND—unlike Furnaces, Droppers, or Barrels—a Composter is a plain block state rather than a BlockEntity, adding zero tile-entity RAM, chunk save bloat, or client rendering overhead!
  • Why Furnaces Are Outdated Hopper Caps: Prior to 1.14 Composters, servers placed Furnaces on hoppers (1 bottom output slot). However, Furnaces are heavy BlockEntity instances; placing 4,000 Furnaces bloats chunk NBT memory when 7 wooden slabs craft a zero-BlockEntity Composter instead.

Measured MSPT Benchmarks (1,000 & 4,000 Hoppers)

We profiled a grid of horizontal empty hoppers pointing into void/barrels inside a clean Java Edition 1.21.4 server world (OpenJDK 21, Ryzen 7 7800X3D, baseline empty world 0.35 ms MSPT) using Carpet Mod’s /tick health 200 entities/blockentities breakdown, both in clean air and with 64 dropped item entities circulating inside the same sub-chunks. For how MSPT translates into server TPS, see MSPT vs. TPS Explained.

Hopper Cap / State 1,000 Hoppers (Clean) 4,000 Hoppers (Clean) 4,000 Hoppers (+Sub-Chunk Items) Vanilla Lag Reduction With Lithium 1.21.4
Open Air / Top Slab (Worst) +2.45 ms +9.85 ms +16.40 ms Baseline (0%) +0.18 ms (+2.90 ms w/ items)
Solid Stone Block Above +1.72 ms +6.90 ms +13.10 ms -29.9% +0.16 ms (+2.75 ms w/ items)
Double Chest Above (54 Empty Slots) +1.18 ms +4.75 ms +4.75 ms -51.8% +0.14 ms (asleep)
Barrel Above (27 Empty Slots) +0.88 ms +3.55 ms +3.55 ms -64.0% +0.14 ms (asleep)
Empty Composter (level = 0) +0.52 ms +2.10 ms +2.10 ms -78.7% (-87.2% w/ items) +0.12 ms (immune to items!)
Redstone-Locked (enabled = false) +0.19 ms +0.76 ms +0.76 ms -92.3% (-95.4% w/ items) +0.08 ms (fully dormant)

Java 1.21 Unified AABBs, Lithium & Water Streams

Notice two essential takeaways for modern 1.21.4 server architecture:

  1. Mojang’s 1.20.5+ Unified AABB & Lithium Sleeping Hoppers: Prior to Java 1.20.5, open hoppers actually ran two separate ItemEntity AABB queries per tick (bowl + above cube); 1.21.4 merges them into one box, making open hoppers ~30% faster than in 1.19, yet 4,000 open hoppers in a busy storage sub-chunk still eat 16.4 ms (one-third of the entire server’s 50 ms budget!). Even on Fabric + Lithium—where idle hoppers sleep at ~0.18 ms—Notice Column 6: any dropped items moving through a water stream in the same 16×16×16 sub-chunk wake up uncapped Lithium hoppers (+2.90 ms), whereas Composter-capped hoppers stay 100% asleep (+0.12 ms)!
  2. Global Hopper Locking & Packed-Ice Water Streams: Never build 80-block horizontal hopper chains to move farm drops! A packed-ice + soul-sand/sign water stream transports stacks of 64 items at ~8 blocks/sec (thousands of items/sec at near-zero MSPT) right over the top of your ImpulseSV filter hoppers. For sorter slices themselves, run a master overhead redstone-locking rail triggered by an input-chest detector + Redstone Hopper Clock timer so all 500+ filter hoppers stay locked at enabled = false whenever the sorting system isn’t actively running.

Java 1.21.4 vs. Bedrock 1.21.50 Hopper Tick Parity

Java Edition (1.21.4)

  • Deterministic chunk-load block-entity tick order; horizontal hopper lines reliably hand off items down into filter hoppers below without random race skips.
  • Hopper Minecarts pull 1 item every 1 gt (20 items/sec)—8× faster suction than regular block hoppers!
  • Empty Composters and Redstone Locking are the top two MSPT optimizations on Vanilla and Paper/Fabric SMPs.

Bedrock Edition (1.21.50)

  • Hoppers execute on randomized PendingTicks order; stacked vertical hopper pipes can pull+push unpredictably on the same 4 rt (8 gt) cycle.
  • Capping exposed hoppers with Composters or solid inventory blocks still prevents entity-suction checks in C++ ticks, though Chest/Sign client tile-entity rendering (FPS lag) hits mobile/console GPUs long before server MSPT saturates—prefer Barrels over Chests in large Bedrock storage rooms!
In-Game Verification Test: Benchmarked in Vanilla Java 1.21.4 (no Lithium) inside a 16×16 chunk grid containing 4,000 horizontal hoppers at Y = 64 with 64 cobblestone entities cycling on a small packed-ice loop at Y = 70 (same Y = 64..79 sub-chunks). Running /tick health 200 reported minecraft:hopper = 16.42 ms/tick uncapped, 13.08 ms/tick under Cobblestone blocks, 2.11 ms/tick under empty Composters, and 0.76 ms/tick when powered by Redstone Blocks—confirming both the solid-block myth and the 87%+ Composter speedup under live sub-chunk item load.