What everything imports
Verified against Minecraft 26.3 · Maps · The thirty most-imported Mojang classes: how many files name each one in an import statement.
One file in six imports BlockPos. That is the least surprising fact on
this page; the next one is not. The chart counts Mojang imports only —
net.minecraft and com.mojang — because the JDK’s List and the
nullability annotation outrank everything on it and say nothing about the
game. Under that rule the second most-imported type is not
Minecraft’s: it is Codec, from Mojang’s DataFixerUpper
library, imported by 943 files, with MapCodec sixth and
RecordCodecBuilder seventh. Three of the seven classes the game most depends
on are the serialisation vocabulary that turns objects into NBT and JSON
and back, which is why Part II teaches codecs before anything a player can
see.
Seven ideas, and where the book teaches them
The hubs are not thirty ideas; twenty-five of them are seven. The table below groups them,
reading down the sixty rows rather than the thirty the figure draws, so that a
family is not broken in half by the cut-off — ByteBufCodecs and PacketType
are the wire’s vocabulary whether or not they clear it. So the table holds
thirty-two names: twenty-five of the thirty, plus seven more from ranks
31 to 60 that their families would be incomplete without. The five of the
thirty it leaves out are the two paragraphs after it, two and three.
Part II teaches three of the seven, Reference two, Part IX one, and the seventh — the world’s nouns — is the rest of the book. That is the more useful fact than Part II teaches the vocabulary: the classes a reader must know are not one part’s worth.
| idea | the hubs | where the book teaches it |
|---|---|---|
| a position | BlockPos, Vec3, Direction, Mth | Math and primitives |
| a name and a registry | Identifier, ResourceKey, Registries, BuiltInRegistries, Holder | Identifiers and registries |
| a shape on disk | Codec, MapCodec, RecordCodecBuilder | Codecs, NBT and JSON, and for MapCodec the data-driven type pattern |
| a shape on the wire | StreamCodec, ByteBufCodecs, RegistryFriendlyByteBuf, Packet, PacketType | Packets and stream codecs |
| text | Component | Text components |
| chance | RandomSource | Math and primitives |
| the world’s nouns | Level, ServerLevel, BlockState, Block, Blocks, Entity, LivingEntity, Player, EntityType, ItemStack, SoundEvents, SoundEvent, DataComponents | Parts II to X |
Two of the thirty belong to no family and get no row above, and neither
does the first class after them; each is worth a look. Minecraft
(284) is thirty-first, the first client-only class on the list and just outside the figure —
the client’s hub is a hub for the client-only side alone, which is under a
third of the files, and the shared seven tenths never name it. And Schema
(404) and DSL (289) are the migration tree talking to itself: all but ten of
the files that import Schema are in util/datafix, and the ten are its
sibling util/filefix. One pair inside the table earns the same second
look: ServerLevel (735) is imported by nearly as many files as Level
(761), because most code that touches the world knows it is on the server and
says so in its types.
The remaining three of the thirty have no row either.
LogUtils (488) is Mojang’s logging library, the one line at the top of a
class that keeps a logger. Util (457) is where the executors and the
static odds and ends live (threads) —
a hub because it is where the unclassifiable went, not because it is an idea.
And BlockBehaviour (313) is the world’s nouns seen one class higher — the
same one-class-higher shape what extends what draws for
the Block tree.
What the count misses
An import is counted once per file, so the chart says how many files
name the class, not how often. It also undercounts every class used
inside its own package, because that needs no import: the 260 files that
import Block are the files outside world/level/block that use it, and
the same is true of BlockBehaviour and Minecraft. A class’s true
reach is this number plus its package.
The table
Sixty rows, of which the figure draws thirty. side is which jar ships the class, or library for a class outside the decompile.
| class | package | imported by | side |
|---|---|---|---|
BlockPos | net.minecraft.core | 1229 | shared |
Codec | com.mojang.serialization | 943 | library |
Identifier | net.minecraft.resources | 914 | shared |
BlockState | net.minecraft.world.level.block.state | 864 | shared |
Holder | net.minecraft.core | 826 | shared |
MapCodec | com.mojang.serialization | 806 | library |
RecordCodecBuilder | com.mojang.serialization.codecs | 797 | library |
RandomSource | net.minecraft.util | 793 | shared |
Component | net.minecraft.network.chat | 777 | shared |
Level | net.minecraft.world.level | 761 | shared |
ServerLevel | net.minecraft.server.level | 735 | shared |
Mth | net.minecraft.util | 703 | shared |
ItemStack | net.minecraft.world.item | 691 | shared |
Entity | net.minecraft.world.entity | 668 | shared |
Vec3 | net.minecraft.world.phys | 585 | shared |
Direction | net.minecraft.core | 584 | shared |
StreamCodec | net.minecraft.network.codec | 547 | shared |
LivingEntity | net.minecraft.world.entity | 536 | shared |
LogUtils | com.mojang.logging | 488 | library |
Registries | net.minecraft.core.registries | 473 | shared |
Util | net.minecraft.util | 457 | shared |
Player | net.minecraft.world.entity.player | 445 | shared |
ResourceKey | net.minecraft.resources | 419 | shared |
Schema | com.mojang.datafixers.schemas | 404 | library |
ByteBufCodecs | net.minecraft.network.codec | 327 | shared |
SoundEvents | net.minecraft.sounds | 320 | shared |
BlockBehaviour | net.minecraft.world.level.block.state | 313 | shared |
Blocks | net.minecraft.world.level.block | 299 | shared |
Packet | net.minecraft.network.protocol | 290 | shared |
DSL | com.mojang.datafixers | 289 | library |
Minecraft | net.minecraft.client | 284 | client |
EntityType | net.minecraft.world.entity | 263 | shared |
Block | net.minecraft.world.level.block | 260 | shared |
DataComponents | net.minecraft.core.component | 258 | shared |
PacketType | net.minecraft.network.protocol | 245 | shared |
RegistryFriendlyByteBuf | net.minecraft.network | 239 | shared |
Dynamic | com.mojang.serialization | 235 | library |
SoundEvent | net.minecraft.sounds | 235 | shared |
ServerPlayer | net.minecraft.server.level | 231 | shared |
BuiltInRegistries | net.minecraft.core.registries | 230 | shared |
LevelReader | net.minecraft.world.level | 228 | shared |
BlockGetter | net.minecraft.world.level | 217 | shared |
Items | net.minecraft.world.item | 215 | shared |
SoundSource | net.minecraft.sounds | 213 | shared |
Pair | com.mojang.datafixers.util | 212 | library |
VoxelShape | net.minecraft.world.phys.shapes | 210 | shared |
EntityTypes | net.minecraft.world.entity | 205 | shared |
Item | net.minecraft.world.item | 204 | shared |
GuiGraphicsExtractor | net.minecraft.client.gui | 200 | client |
Registry | net.minecraft.core | 199 | shared |
BlockTags | net.minecraft.tags | 198 | shared |
LootContext | net.minecraft.world.level.storage.loot | 196 | shared |
ExtraCodecs | net.minecraft.util | 192 | shared |
PoseStack | com.mojang.blaze3d.vertex | 192 | client |
ModelPart | net.minecraft.client.model.geom | 191 | client |
InteractionResult | net.minecraft.world | 190 | shared |
CommandSyntaxException | com.mojang.brigadier.exceptions | 188 | library |
CommandSourceStack | net.minecraft.commands | 188 | shared |
ValueOutput | net.minecraft.world.level.storage | 186 | shared |
TypeRewriteRule | com.mojang.datafixers | 186 | library |
Rules: names, never code · how the system works, not how the code reads ·
newest version only · every backticked name passes tools/verify_names.py.