Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Where the mass is

Verified against Minecraft 26.3 · Maps · The forty largest classes by lines of decompiled source, the top thirty of them drawn, coloured by which jar ships them.

The two largest classes in the game are the top of one hierarchy: Entity and LivingEntity, 9,078 lines between them, the thing every mob and player is before it is anything else. Third is Minecraft, the client itself. And then the list turns odd: two of the top ten are not game logic at all. BlockModelGenerators runs only inside the data generator — its single caller is ModelProvider — and writes the block model JSON that ships in the jar; BlockStateData is a table that the save-migration fixes consult when data a much older version saved is read, and nothing outside util/datafix reads it. Size is where the reading is, not where the game is.

The 30 largest classes of 26.3 by lines of decompiled source Entity (world/entity): 4,617 lines Entity world/entity 4,617 LivingEntity (world/entity): 4,461 lines LivingEntity world/entity 4,461 Minecraft (client): 3,345 lines Minecraft client 3,345 BlockModelGenerators (client/data/models): 3,136 lines BlockModelGenerators client/data/models 3,136 ClientPacketListener (client/multiplayer): 3,090 lines ClientPacketListener client/multiplayer 3,090 MinecraftServer (server): 2,608 lines MinecraftServer server 2,608 ServerGamePacketListenerImpl (server/network): 2,567 lines ServerGamePacketListenerImpl server/network 2,567 ServerPlayer (server/level): 2,516 lines ServerPlayer server/level 2,516 BlockStateData (util/datafix/fixes): 2,270 lines BlockStateData util/datafix/fixes 2,270 ServerLevel (server/level): 2,139 lines ServerLevel server/level 2,139 Items (world/item): 2,067 lines Items world/item 2,067 Blocks (world/level/block): 2,061 lines Blocks world/level/block 2,061 Player (world/entity/player): 2,034 lines Player world/entity/player 2,034 SoundEvents (sounds): 2,023 lines SoundEvents sounds 2,023 Options (client): 2,010 lines Options client 2,010 OceanMonumentPieces (world/level/levelgen/structure/structures): 1,983 lines OceanMonumentPieces world/level/levelgen/structure/structures 1,983 CreativeModeTabs (world/item): 1,737 lines CreativeModeTabs world/item 1,737 ChunkMap (server/level): 1,661 lines ChunkMap server/level 1,661 DataFixers (util/datafix): 1,637 lines DataFixers util/datafix 1,637 Fox (world/entity/animal/fox): 1,625 lines Fox world/entity/animal/fox 1,625 Mob (world/entity): 1,616 lines Mob world/entity 1,616 LevelRenderer (client/renderer): 1,499 lines LevelRenderer client/renderer 1,499 Hud (client/gui): 1,481 lines Hud client/gui 1,481 Bee (world/entity/animal/bee): 1,450 lines Bee world/entity/animal/bee 1,450 StrongholdPieces (world/level/levelgen/structure/structures): 1,436 lines StrongholdPieces world/level/levelgen/structure/structures 1,436 LocalPlayer (client/player): 1,435 lines LocalPlayer client/player 1,435 FriendlyByteBuf (network): 1,414 lines FriendlyByteBuf network 1,414 VanillaBlockLoot (data/loot/packs): 1,412 lines VanillaBlockLoot data/loot/packs 1,412 BlockBehaviour (world/level/block/state): 1,380 lines BlockBehaviour world/level/block/state 1,380 Util (util): 1,372 lines Util util 1,372
The thirty largest classes of 26.3. Blue ships in both jars, orange is client-only; the small grey text is the package under net/minecraft, or under com/mojang where it starts mojang/. Click to enlarge.

64,082 lines are in these thirty classes, 8.6% of the game in 0.4% of its files.

Three kinds of big

Read down the bars and twenty-four of the thirty sort themselves into three kinds, and the kind tells you how to read the class.

The god objects. Entity and LivingEntity are the trunk, each over four thousand lines because each is the base of everything below it. The fork below them is not one chain: Mob is one of LivingEntity‘s direct subclasses and Avatar is another, with Player under it and ServerPlayer and LocalPlayer its two leaves in the thirty (entity anatomy has the tree). Those two leaves are long for the opposite reason to the trunk: no named class descends from either, and each is a whole side of the authority split written out. Minecraft and MinecraftServer are the two programs’ roots; ServerLevel is the world; ChunkMap is the world’s loader. Only two concrete mobs make the thirty — Fox and Bee, the two with the most bespoke behaviour in their own files — and what they are long with is per-species goal classes, which is exactly why Part VI explains the machine and declines to enumerate its instances: there is no Fox page and there is not going to be one.

The switchboards. ClientPacketListener is a handler method for every clientbound play packet, and ServerGamePacketListenerImpl is the same for every serverbound one — all but three of the packets both phases share are handled one class up, in ClientCommonPacketListenerImpl and ServerCommonPacketListenerImpl; between them they are the whole of what play can say, which is why Part IX’s pages keep coming back to them. FriendlyByteBuf is the buffer their packets are read from.

The catalogues written as code. SoundEvents, Blocks and Items are registries populated a constant at a time, and CreativeModeTabs lists every tab’s items a line apiece; DataFixers is the migration history; OceanMonumentPieces and StrongholdPieces are structures built by hand, room by room, in Java rather than in a template; Options is every setting in options.txt, and Hud is the in-world overlay — the crosshair, the hotbar, the bars — inside the wider Gui that also draws screens, toasts and the loading overlay. These are long because they are lists. None is hard.

The table

Forty rows, of which the figure draws thirty. side is which jar ships the class.

classlinesside
net/minecraft/world/entity/Entity4,617shared
net/minecraft/world/entity/LivingEntity4,461shared
net/minecraft/client/Minecraft3,345client
net/minecraft/client/data/models/BlockModelGenerators3,136client
net/minecraft/client/multiplayer/ClientPacketListener3,090client
net/minecraft/server/MinecraftServer2,608shared
net/minecraft/server/network/ServerGamePacketListenerImpl2,567shared
net/minecraft/server/level/ServerPlayer2,516shared
net/minecraft/util/datafix/fixes/BlockStateData2,270shared
net/minecraft/server/level/ServerLevel2,139shared
net/minecraft/world/item/Items2,067shared
net/minecraft/world/level/block/Blocks2,061shared
net/minecraft/world/entity/player/Player2,034shared
net/minecraft/sounds/SoundEvents2,023shared
net/minecraft/client/Options2,010client
net/minecraft/world/level/levelgen/structure/structures/OceanMonumentPieces1,983shared
net/minecraft/world/item/CreativeModeTabs1,737shared
net/minecraft/server/level/ChunkMap1,661shared
net/minecraft/util/datafix/DataFixers1,637shared
net/minecraft/world/entity/animal/fox/Fox1,625shared
net/minecraft/world/entity/Mob1,616shared
net/minecraft/client/renderer/LevelRenderer1,499client
net/minecraft/client/gui/Hud1,481client
net/minecraft/world/entity/animal/bee/Bee1,450shared
net/minecraft/world/level/levelgen/structure/structures/StrongholdPieces1,436shared
net/minecraft/client/player/LocalPlayer1,435client
net/minecraft/network/FriendlyByteBuf1,414shared
net/minecraft/data/loot/packs/VanillaBlockLoot1,412shared
net/minecraft/world/level/block/state/BlockBehaviour1,380shared
net/minecraft/util/Util1,372shared
net/minecraft/gametest/framework/GameTestHelper1,369shared
com/mojang/realmsclient/RealmsMainScreen1,344client
net/minecraft/client/multiplayer/ClientLevel1,334client
net/minecraft/world/level/levelgen/structure/structures/NetherFortressPieces1,317shared
net/minecraft/world/item/ItemStack1,274shared
net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces1,185shared
net/minecraft/world/entity/animal/panda/Panda1,121shared
net/minecraft/world/entity/animal/equine/AbstractHorse1,115shared
net/minecraft/client/gui/screens/inventory/CreativeModeInventoryScreen1,107client
net/minecraft/world/entity/monster/cubemob/SulfurCube1,083shared

Rules: names, never code · how the system works, not how the code reads · newest version only · every backticked name passes tools/verify_names.py.