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 code is

Verified against Minecraft 26.3 · Maps · The jar as a treemap of packages: area is lines of decompiled source, colour is which jar ships the package, hatching is the packages Part I’s what this book skips tours.

Java Minecraft is 7,301 classes and 741,069 lines of decompiled Java 25, and the first surprise in it is how little of that the client owns alone. Everything a player sees — every screen, the HUD, the whole renderer, the entity models, both GPU back-ends, the sound engine, Realms — is the orange near-third of this picture. The blue seven tenths ship in both jars, and the biggest inner box, world/level, is a fifth of the game by itself: blocks, block states, chunks, lighting and world generation, all of it code the dedicated server runs with no window attached.

The 26.3 jar as a treemap of packages: area is lines of decompiled source, colour is which jar ships the package, hatching marks the packages what this book skips tours net/minecraft/world — 2715 classes, 313,098 lines, shared net/minecraft/world/level — 1418 classes, 151,146 lines, shared level 151,146 net/minecraft/world/entity — 727 classes, 110,760 lines, shared entity 110,760 net/minecraft/world/item — 323 classes, 30,661 lines, shared item 30,661 net/minecraft/world/inventory — 64 classes, 7,152 lines, shared inventory 7,152 net/minecraft/world/phys — 28 classes, 3,036 lines, shared phys net/minecraft/world/attribute — 30 classes, 1,936 lines, shared net/minecraft/world — 25 classes, 1,686 lines, shared net/minecraft/world/scores — 16 classes, 1,442 lines, shared net/minecraft/world/effect — 20 classes, 1,306 lines, shared net/minecraft/world/damagesource — 12 classes, 936 lines, shared net/minecraft/world/ticks — 14 classes, 869 lines, shared net/minecraft/world/waypoints — 9 classes, 677 lines, shared net/minecraft/world/timeline — 5 classes, 446 lines, shared net/minecraft/world/clock — 11 classes, 390 lines, shared net/minecraft/world/flag — 7 classes, 356 lines, shared net/minecraft/world/food — 6 classes, 299 lines, shared world 42% net/minecraft/client — 1891 classes, 176,818 lines, client-only net/minecraft/client/gui — 445 classes, 59,594 lines, client-only gui 59,594 net/minecraft/client/renderer — 715 classes, 50,649 lines, client-only renderer 50,649 net/minecraft/client/model — 268 classes, 12,712 lines, client-only model 12,712 net/minecraft/client/multiplayer — 63 classes, 11,303 lines, client-only multiplayer 11,303 net/minecraft/client — 41 classes, 10,821 lines, client-only (itself) 10,821 net/minecraft/client/resources — 110 classes, 8,326 lines, client-only resources 8,326 net/minecraft/client/particle — 88 classes, 6,839 lines, client-only particle 6,839 net/minecraft/client/data — 28 classes, 6,189 lines, client-only — toured in what this book skips data 6,189 net/minecraft/client/sounds — 17 classes, 2,174 lines, client-only sounds net/minecraft/client/player — 11 classes, 2,072 lines, client-only player net/minecraft/client/telemetry — 18 classes, 1,221 lines, client-only — toured in what this book skips net/minecraft/client/server — 6 classes, 885 lines, client-only net/minecraft/client/color — 17 classes, 879 lines, client-only net/minecraft/client/tutorial — 10 classes, 671 lines, client-only net/minecraft/client/main — 4 classes, 523 lines, client-only net/minecraft/client/animation — 23 classes, 509 lines, client-only net/minecraft/client/searchtree — 8 classes, 505 lines, client-only net/minecraft/client/input — 8 classes, 304 lines, client-only net/minecraft/client/quickplay — 3 classes, 284 lines, client-only net/minecraft/client/entity — 4 classes, 228 lines, client-only net/minecraft/client/profiling — 2 classes, 81 lines, client-only net/minecraft/client/waypoints — 2 classes, 49 lines, client-only client 24% net/minecraft/util — 735 classes, 54,700 lines, shared net/minecraft/util/datafix — 411 classes, 27,048 lines, shared — toured in what this book skips datafix 27,048 net/minecraft/util — 93 classes, 12,767 lines, shared (itself) 12,767 net/minecraft/util/profiling — 70 classes, 4,265 lines, shared — toured in what this book skips profiling 4,265 net/minecraft/util/filefix — 57 classes, 3,553 lines, shared — toured in what this book skips filefix net/minecraft/util/parsing — 29 classes, 1,879 lines, shared net/minecraft/util/debug — 19 classes, 1,348 lines, shared net/minecraft/util/worldupdate — 6 classes, 958 lines, shared net/minecraft/util/thread — 9 classes, 842 lines, shared net/minecraft/util/valueproviders — 19 classes, 707 lines, shared net/minecraft/util/eventlog — 4 classes, 459 lines, shared net/minecraft/util/random — 4 classes, 374 lines, shared net/minecraft/util/debugchart — 8 classes, 199 lines, shared net/minecraft/util/context — 4 classes, 181 lines, shared net/minecraft/util/monitoring — 2 classes, 120 lines, shared util 7% net/minecraft/server — 432 classes, 53,789 lines, shared net/minecraft/server/commands — 111 classes, 13,357 lines, shared commands 13,357 net/minecraft/server/level — 42 classes, 12,166 lines, shared level 12,166 net/minecraft/server/network — 29 classes, 5,566 lines, shared network 5,566 net/minecraft/server — 27 classes, 5,153 lines, shared (itself) 5,153 net/minecraft/server/packs — 57 classes, 5,122 lines, shared packs 5,122 net/minecraft/server/jsonrpc — 65 classes, 4,118 lines, shared — toured in what this book skips jsonrpc 4,118 net/minecraft/server/players — 19 classes, 2,770 lines, shared players net/minecraft/server/dedicated — 7 classes, 1,811 lines, shared net/minecraft/server/dialog — 35 classes, 885 lines, shared net/minecraft/server/rcon — 9 classes, 837 lines, shared — toured in what this book skips net/minecraft/server/permissions — 12 classes, 402 lines, shared net/minecraft/server/chase — 3 classes, 354 lines, shared net/minecraft/server/notifications — 5 classes, 343 lines, shared net/minecraft/server/bossevents — 3 classes, 328 lines, shared net/minecraft/server/gui — 4 classes, 310 lines, shared net/minecraft/server/waypoints — 2 classes, 180 lines, shared net/minecraft/server/advancements — 2 classes, 87 lines, shared server 7% net/minecraft/network — 416 classes, 23,319 lines, shared net/minecraft/network/protocol — 298 classes, 12,872 lines, shared protocol 12,872 net/minecraft/network/chat — 63 classes, 4,799 lines, shared chat 4,799 net/minecraft/network — 42 classes, 3,590 lines, shared net/minecraft/network/codec — 7 classes, 1,533 lines, shared net/minecraft/network/syncher — 6 classes, 525 lines, shared network 3% com/mojang/renderpearl — 146 classes, 18,659 lines, client-only com/mojang/renderpearl/backend — 76 classes, 13,866 lines, client-only backend 13,866 com/mojang/renderpearl/frontend — 12 classes, 2,876 lines, client-only frontend com/mojang/renderpearl/api — 53 classes, 1,879 lines, client-only api com/mojang/renderpearl/util — 4 classes, 34 lines, client-only com/mojang/renderpearl — 1 classes, 4 lines, client-only renderpearl net/minecraft/data — 174 classes, 16,849 lines, shared net/minecraft/data/worldgen — 64 classes, 6,016 lines, shared — toured in what this book skips worldgen 6,016 net/minecraft/data/loot — 21 classes, 3,023 lines, shared — toured in what this book skips loot 3,023 net/minecraft/data/recipes — 20 classes, 2,507 lines, shared — toured in what this book skips net/minecraft/data/tags — 29 classes, 1,756 lines, shared — toured in what this book skips tags net/minecraft/data — 10 classes, 1,272 lines, shared — toured in what this book skips net/minecraft/data/advancements — 10 classes, 896 lines, shared — toured in what this book skips net/minecraft/data/info — 8 classes, 518 lines, shared — toured in what this book skips net/minecraft/data/structures — 5 classes, 473 lines, shared — toured in what this book skips net/minecraft/data/registries — 5 classes, 325 lines, shared — toured in what this book skips net/minecraft/data/metadata — 2 classes, 63 lines, shared — toured in what this book skips data 2% com/mojang/realmsclient — 137 classes, 14,701 lines, client-only com/mojang/realmsclient/gui — 46 classes, 7,091 lines, client-only — toured in what this book skips gui 7,091 com/mojang/realmsclient/client — 19 classes, 2,643 lines, client-only — toured in what this book skips client com/mojang/realmsclient/dto — 43 classes, 1,986 lines, client-only — toured in what this book skips dto com/mojang/realmsclient — 4 classes, 1,492 lines, client-only — toured in what this book skips com/mojang/realmsclient/util — 20 classes, 1,425 lines, client-only — toured in what this book skips util com/mojang/realmsclient/exception — 5 classes, 64 lines, client-only — toured in what this book skips realmsclient net/minecraft/commands — 124 classes, 13,229 lines, shared net/minecraft/commands/arguments — 73 classes, 9,017 lines, shared arguments 9,017 net/minecraft/commands — 14 classes, 1,921 lines, shared net/minecraft/commands/synchronization — 12 classes, 905 lines, shared net/minecraft/commands/execution — 18 classes, 756 lines, shared net/minecraft/commands/functions — 7 classes, 630 lines, shared commands 2% net/minecraft/core — 123 classes, 12,359 lines, shared net/minecraft/core — 39 classes, 5,499 lines, shared (itself) 5,499 net/minecraft/core/component — 32 classes, 3,067 lines, shared net/minecraft/core/registries — 14 classes, 1,525 lines, shared net/minecraft/core/dispenser — 14 classes, 1,098 lines, shared net/minecraft/core/particles — 21 classes, 863 lines, shared net/minecraft/core/cauldron — 3 classes, 307 lines, shared core 2% com/mojang/blaze3d — 86 classes, 10,437 lines, client-only com/mojang/blaze3d/platform — 26 classes, 4,382 lines, client-only com/mojang/blaze3d/vertex — 14 classes, 2,322 lines, client-only vertex com/mojang/blaze3d/audio — 12 classes, 1,013 lines, client-only — toured in what this book skips com/mojang/blaze3d/systems — 5 classes, 773 lines, client-only com/mojang/blaze3d/framegraph — 3 classes, 437 lines, client-only com/mojang/blaze3d/font — 7 classes, 432 lines, client-only com/mojang/blaze3d/pipeline — 5 classes, 366 lines, client-only com/mojang/blaze3d — 5 classes, 289 lines, client-only com/mojang/blaze3d/buffers — 3 classes, 228 lines, client-only com/mojang/blaze3d/resource — 6 classes, 195 lines, client-only blaze3d 1% net/minecraft/nbt — 43 classes, 7,791 lines, shared net/minecraft/nbt — 36 classes, 7,279 lines, shared (itself) 7,279 net/minecraft/nbt/visitors — 7 classes, 512 lines, shared nbt 1% net/minecraft/advancements — 115 classes, 7,647 lines, shared net/minecraft/advancements/predicates — 53 classes, 3,450 lines, shared net/minecraft/advancements/triggers — 49 classes, 2,816 lines, shared net/minecraft/advancements — 13 classes, 1,381 lines, shared net/minecraft/gametest — 48 classes, 5,756 lines, shared net/minecraft/gametest/framework — 46 classes, 5,737 lines, shared net/minecraft/gametest — 2 classes, 19 lines, shared net/minecraft/sounds — 6 classes, 2,124 lines, shared net/minecraft/sounds — 6 classes, 2,124 lines, shared sounds net/minecraft/tags — 29 classes, 1,874 lines, shared net/minecraft/tags — 29 classes, 1,874 lines, shared tags net/minecraft — 19 classes, 1,665 lines, shared net/minecraft — 19 classes, 1,665 lines, shared net/minecraft/references — 5 classes, 1,483 lines, shared net/minecraft/references — 5 classes, 1,483 lines, shared — toured in what this book skips net/minecraft/resources — 12 classes, 1,473 lines, shared net/minecraft/resources — 12 classes, 1,473 lines, shared com/mojang/math — 10 classes, 1,054 lines, shared com/mojang/math — 10 classes, 1,054 lines, shared math net/minecraft/stats — 10 classes, 874 lines, shared net/minecraft/stats — 10 classes, 874 lines, shared — toured in what this book skips net/minecraft/gizmos — 15 classes, 569 lines, shared net/minecraft/gizmos — 15 classes, 569 lines, shared — toured in what this book skips net/minecraft/recipebook — 3 classes, 351 lines, shared net/minecraft/locale — 3 classes, 247 lines, shared net/minecraft/realms — 4 classes, 203 lines, client-only in both jars client only hatched: toured in what this book skips 741,069 lines, 7301 classes — area is lines of decompiled source
The 26.3 decompile as a treemap. Each outer box is a package directly under net/minecraft or com/mojang, labelled with its share of the lines where the box has room for it; the boxes inside are its sub-packages. Hover a box for its counts; click the figure to enlarge it.

Two jars, one tree

The client jar is a strict superset of the server jar, and the split is clean: the 2,264 client-only classes live in exactly five packages — net/minecraft/client (1,891 classes), com/mojang/renderpearl (146), com/mojang/realmsclient (137), com/mojang/blaze3d (86) and net/minecraft/realms (4). Every other package in the table below ships in both jars, class for class; no sub-package at this depth is mixed. The client-only side is 220,818 lines, 29.8% of the total, which is the “just under a third” the introduction quotes.

The consequence for reading this book: when a page says a class is client-only it is saying which package the class lives in, and every package Parts IV and V own ships in both jars. The oracle for which side a class is on is server-classes.txt.

What the big boxes are

world — 42%. world/level (151,146 lines, 1,418 classes) is Parts IV, V and XII: chunks, block states, lighting and, under world/level/levelgen, most of world generation — world/level/biome is its sibling rather than part of it. world/entity (110,760 lines, 727 classes) is Parts VI and VIII: the entity hierarchy, its AI and the player. world/item and world/inventory (37,813 lines between them) are Part VII.

client — 24%. client/gui (59,594 lines) is the screens and the HUD, Part X; client/renderer and client/model (63,361 lines together) are the frame, section meshing and the entity models, Part XI; client/multiplayer (11,303) holds ClientPacketListener and ClientLevel, the client’s copy of the world. The 41 classes directly in net/minecraft/client — Minecraft, Options, KeyMapping, MouseHandler — are 10,821 lines on their own. (That 41 is the itself only count defined below; the 1,891 above is the package with every sub-package under it.)

util — 7%, two thirds of it skipped. util/datafix, util/filefix and util/profiling are 34,866 of the package’s 54,700 lines and are all outside this book; the hatched boxes are those three, and much the largest of them is the save-migration history. What is left is the toolbox every part uses — Mth, RandomSource, Util — and the parsing and debug packages.

server — 7%. server/commands (13,357) is Part XIII’s command implementations; server/level is 42 classes and 12,166 lines — 290 lines a class, nearly three times the map’s average, in a package small enough to list (ServerLevel, ChunkMap, ServerPlayer), Parts III and IV; server/network is the serverbound packet handlers, Part IX; server/packs is the pack system, Part II; server/jsonrpc, the management server, is skipped.

renderpearl and blaze3d — 4%. The GPU abstraction, com/mojang/renderpearl, has two back-ends behind GpuDevice, and the Vulkan one (renderpearl/backend/vulkan, 7,387 lines) is larger than the OpenGL one (renderpearl/backend/opengl, 5,815); com/mojang/blaze3d keeps the window, the frame graph, the vertex formats and RenderSystem.

network — 3%, in 416 classes. network/protocol is 298 classes in 12,872 lines: the packet catalogue is many tiny classes, one per packet. network/chat (4,799) is Component and chat signing.

Below 3% the other boxes include Part II’s foundations — net/minecraft/core, net/minecraft/nbt, net/minecraft/tags, net/minecraft/resources — and Part XIII’s net/minecraft/commands (the command source, the argument types and the execution engine) and net/minecraft/advancements, plus com/mojang/realmsclient and the skipped net/minecraft/data. That last one is the program that writes the vanilla data pack — and it is not build-time only: the dedicated server ships all 174 classes, and Blocks and MinecraftServer both read data/worldgen constants at run time (what this book skips sorts every such reader into three kinds).

Where each part lives

The parts follow the tree, but not one box each. This table is the map from the book’s order to the jar’s, and it is the one table on this page that is a decision rather than a measurement: the packages are assigned by hand, in the tool that draws the atlas, and the counts follow. A package under net/minecraft is written without that prefix; itself only means the files directly in the package and not its sub-packages; a package two parts share is counted in both and a file in no part’s packages in none, so the total row is not the jar’s. A landing page that states its part’s size quotes its own row of this table, and the hatched packages and player reporting are left out of every row.

partpackagesclassesclient-onlylines
I · Anatomyclient/main, Minecraft, Main, MinecraftServer756,817
II · Foundationscore, resources, tags, nbt, server/packs, util, world/flag468048,809
III · The serverserver (itself only), server/level, server/players, server/dedicated95021,900
IV · The worldworld/level/chunk, world/level/lighting, world/ticks, world/level/gameevent, world/level/entity, world/level/material, world/attribute, world/timeline, world/clock, world/level/border, server/level, world/level/blockscan229031,913
V · Blocksworld/level/block, world/level/redstone484058,507
VI · Entitiesworld/entity, network/syncher, world/level/pathfinder, world/damagesource, world/effect, minus world/entity/player7660112,091
VII · Items and inventoriesworld/item, world/inventory, world/level/storage/loot581049,245
VIII · The playerworld/entity/player, world/food, ServerPlayer, client/player32118,460
IX · Networkingnetwork, server/network, client/multiplayer, minus network/syncher4905138,711
X · The clientclient (itself only), client/gui, client/multiplayer, client/sounds, client/resources, client/player, client/input, client/server68968994,527
XI · Renderingclient/renderer, client/model, client/particle, com/mojang/blaze3d, com/mojang/renderpearl1,2911,29198,283
XII · World generationworld/level/levelgen, world/level/biome477049,303
XIII · Commands and data packscommands, server/commands, server/dialog, server/permissions, server/bossevents, advancements, gametest, world/scores, client/gui/screens/dialog4811744,083
the thirteen parts, with the shared packages counted twice6,0902,064662,649

The table

Depth three is the outer boxes of the treemap; depth four is the inner ones. client-only counts the classes not in server-classes.txt.

package (depth 3)classesclient-onlylines
net/minecraft/world27150313,098
net/minecraft/client18911891176,818
net/minecraft/util735054,700
net/minecraft/server432053,789
net/minecraft/network416023,319
com/mojang/renderpearl14614618,659
net/minecraft/data174016,849
com/mojang/realmsclient13713714,701
net/minecraft/commands124013,229
net/minecraft/core123012,359
com/mojang/blaze3d868610,437
net/minecraft/nbt4307,791
net/minecraft/advancements11507,647
net/minecraft/gametest4805,756
net/minecraft/sounds602,124
net/minecraft/tags2901,874
net/minecraft1901,665
net/minecraft/references501,483
net/minecraft/resources1201,473
com/mojang/math1001,054
net/minecraft/stats100874
net/minecraft/gizmos150569
net/minecraft/recipebook30351
net/minecraft/locale30247
net/minecraft/realms44203
total73012264741,069
package (depth 4)classesclient-onlylines
net/minecraft/world/level14180151,146
net/minecraft/world/entity7270110,760
net/minecraft/client/gui44544559,594
net/minecraft/client/renderer71571550,649
net/minecraft/world/item323030,661
net/minecraft/util/datafix411027,048
com/mojang/renderpearl/backend767613,866
net/minecraft/server/commands111013,357
net/minecraft/network/protocol298012,872
net/minecraft/util93012,767
net/minecraft/client/model26826812,712
net/minecraft/server/level42012,166
net/minecraft/client/multiplayer636311,303
net/minecraft/client414110,821
net/minecraft/commands/arguments7309,017
net/minecraft/client/resources1101108,326
net/minecraft/nbt3607,279
net/minecraft/world/inventory6407,152
com/mojang/realmsclient/gui46467,091
net/minecraft/client/particle88886,839
net/minecraft/client/data28286,189
net/minecraft/data/worldgen6406,016
net/minecraft/gametest/framework4605,737
net/minecraft/server/network2905,566
net/minecraft/core3905,499
net/minecraft/server2705,153
net/minecraft/server/packs5705,122
net/minecraft/network/chat6304,799
com/mojang/blaze3d/platform26264,382
net/minecraft/util/profiling7004,265
net/minecraft/server/jsonrpc6504,118
net/minecraft/network4203,590
net/minecraft/util/filefix5703,553
net/minecraft/advancements/predicates5303,450
net/minecraft/core/component3203,067
net/minecraft/world/phys2803,036
net/minecraft/data/loot2103,023
com/mojang/renderpearl/frontend12122,876
net/minecraft/advancements/triggers4902,816
net/minecraft/server/players1902,770
com/mojang/realmsclient/client19192,643
net/minecraft/data/recipes2002,507
com/mojang/blaze3d/vertex14142,322
net/minecraft/client/sounds17172,174
net/minecraft/sounds602,124
net/minecraft/client/player11112,072
com/mojang/realmsclient/dto43431,986
net/minecraft/world/attribute3001,936
net/minecraft/commands1401,921
com/mojang/renderpearl/api53531,879
net/minecraft/util/parsing2901,879
net/minecraft/tags2901,874
net/minecraft/server/dedicated701,811
net/minecraft/data/tags2901,756
net/minecraft/world2501,686
net/minecraft1901,665
net/minecraft/network/codec701,533
net/minecraft/core/registries1401,525
com/mojang/realmsclient441,492
net/minecraft/references501,483
net/minecraft/resources1201,473
net/minecraft/world/scores1601,442
com/mojang/realmsclient/util20201,425
net/minecraft/advancements1301,381
net/minecraft/util/debug1901,348
net/minecraft/world/effect2001,306
net/minecraft/data1001,272
net/minecraft/client/telemetry18181,221
net/minecraft/core/dispenser1401,098
com/mojang/math1001,054
com/mojang/blaze3d/audio12121,013
net/minecraft/util/worldupdate60958
net/minecraft/world/damagesource120936
net/minecraft/commands/synchronization120905
net/minecraft/data/advancements100896
net/minecraft/client/server66885
net/minecraft/server/dialog350885
net/minecraft/client/color1717879
net/minecraft/stats100874
net/minecraft/world/ticks140869
net/minecraft/core/particles210863
net/minecraft/util/thread90842
net/minecraft/server/rcon90837
com/mojang/blaze3d/systems55773
net/minecraft/commands/execution180756
net/minecraft/util/valueproviders190707
net/minecraft/world/waypoints90677
net/minecraft/client/tutorial1010671
net/minecraft/commands/functions70630
net/minecraft/gizmos150569
net/minecraft/network/syncher60525
net/minecraft/client/main44523
net/minecraft/data/info80518
net/minecraft/nbt/visitors70512
net/minecraft/client/animation2323509
net/minecraft/client/searchtree88505
net/minecraft/data/structures50473
net/minecraft/util/eventlog40459
net/minecraft/world/timeline50446
com/mojang/blaze3d/framegraph33437
com/mojang/blaze3d/font77432
net/minecraft/server/permissions120402
net/minecraft/world/clock110390
net/minecraft/util/random40374
com/mojang/blaze3d/pipeline55366
net/minecraft/world/flag70356
net/minecraft/server/chase30354
net/minecraft/recipebook30351
net/minecraft/server/notifications50343
net/minecraft/server/bossevents30328
net/minecraft/data/registries50325
net/minecraft/server/gui40310
net/minecraft/core/cauldron30307
net/minecraft/client/input88304
net/minecraft/world/food60299
com/mojang/blaze3d55289
net/minecraft/client/quickplay33284
net/minecraft/locale30247
com/mojang/blaze3d/buffers33228
net/minecraft/client/entity44228
net/minecraft/realms44203
net/minecraft/util/debugchart80199
com/mojang/blaze3d/resource66195
net/minecraft/util/context40181
net/minecraft/server/waypoints20180
net/minecraft/util/monitoring20120
net/minecraft/server/advancements2087
net/minecraft/client/profiling2281
com/mojang/realmsclient/exception5564
net/minecraft/data/metadata2063
net/minecraft/client/waypoints2249
com/mojang/renderpearl/util4434
net/minecraft/gametest2019
com/mojang/renderpearl114
total73012264741,069

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