What extends what
Verified against Minecraft 26.3 · Maps · The widest inheritance trees, four of them drawn with the number of descendants on every branch.
Block has 297 descendants and Entity 192 — descendants, not direct
subclasses, which is the count both tables below use — and those are the two
trees a reader of this book will climb most often. But neither is the widest
hierarchy in the game. That is FeatureElement, with 386 descendants from
seven implementers — and it is not a hierarchy at all. It is an
interface for anything that can be put behind a feature flag, and its
seven implementers are BlockBehaviour, Item, EntityType, MenuType,
MobEffect, Potion and GameRule, so its descendant count sweeps up the
whole block tree and the whole item tree at once. ItemLike, second at 366, is Block plus
Item. The interface table is a list of which mix-ins reach furthest; the
class table is where the real trees are, and four of them are drawn below.
Entity
Entity tree to three levels. The number is how many types descend from the node; subclasses with no subclasses of their own are folded into one italic line per parent, or named where a parent has only one. Click to enlarge.The shape is a spine with a few branches. LivingEntity holds 124 of the
192, Mob 114 of those, PathfinderMob 108 of those: nearly every mob is four
classes deep before it is a species, and Part VI’s
entity anatomy is that spine.
The non-living entities are two families and a scattering — Projectile
(26) and VehicleEntity (15), then hanging things, displays, and
thirteen direct subclasses of Entity with no children of their own, from
ItemEntity to LightningBolt.
Block
Block tree to three levels; 61 of its 92 direct subclasses have no subclasses of their own and are folded into the last line. Click to enlarge.Block is wide and shallow: 92 direct subclasses, most of them terminal.
The one deep branch is BaseEntityBlock (64), the abstract base most of the
blocks that own a block entity extend — the interface that actually decides is
EntityBlock, and two blocks implement it without taking that base at all,
ComparatorBlock and JigsawBlock. Part V’s
block entities
is the branch in prose.
The table’s first row, BlockBehaviour at 298, is the same tree seen from
one class higher — Block is its only subclass, and it exists so that a
block’s behaviour and its registry identity can be separate classes.
Item
Item tree to three levels. Click to enlarge.Sixty-seven types descend from Item, for over a thousand registered items. The tree is
small because an item’s behaviour mostly is not in its class: what a stack
does is in its data components, and Items registers most of the game
as a plain Item or BlockItem with an Item.Properties describing it. Part VII’s
items and stacks is why the tree
is this shape.
Screen
Screen tree to three levels; 59 of its 71 direct subclasses have no subclasses of their own. Click to enlarge.Screen (161) is Block’s shape again — 71 direct subclasses, 59 of
them terminal — with one deep branch, AbstractContainerScreen (27), the
screens that show a menu (GUI and
screens is Part X’s), and one branch that
is not in this book, RealmsScreen (27). The row above it in the table,
AbstractContainerEventHandler at 162, is Screen’s parent with Screen
as its only subclass, the same one-class-higher effect as
BlockBehaviour.
Two trees the table shows and the figures do not
Goal has 202 descendants from 99 direct subclasses, and 132 of the 202
are nested classes, all but one inside the mob they serve — a fox’s own goals
are declared in Fox, not in world/entity/ai/goal. Packet is an interface with 240 descendants from 229
direct implementers, and almost nothing below them: the packet catalogue is
flat, and the packets reference is its list.
The tables
Class roots first, then interface roots; each table is the thirty roots of its kind with the most descendants. direct is the number of immediate subclasses or implementers; where is the package of the root.
| root | descendants | direct | kind | where |
|---|---|---|---|---|
BlockBehaviour | 298 | 1 | class | net/minecraft/world/level/block/state |
Block | 297 | 92 | class | net/minecraft/world/level/block |
Goal | 202 | 99 | class | net/minecraft/world/entity/ai/goal |
Entity | 192 | 18 | class | net/minecraft/world/entity |
Model | 170 | 14 | class | net/minecraft/client/model |
AbstractContainerEventHandler | 162 | 1 | class | net/minecraft/client/gui/components/events |
Screen | 161 | 71 | class | net/minecraft/client/gui/screens |
EntityModel | 153 | 71 | class | net/minecraft/client/model |
EntityRenderer | 133 | 28 | class | net/minecraft/client/renderer/entity |
LivingEntity | 124 | 3 | class | net/minecraft/world/entity |
Mob | 114 | 5 | class | net/minecraft/world/entity |
PathfinderMob | 108 | 5 | class | net/minecraft/world/entity |
NamespacedSchema | 107 | 107 | class | net/minecraft/util/datafix/schemas |
EntityRenderState | 99 | 23 | class | net/minecraft/client/renderer/entity/state |
AbstractWidget | 99 | 12 | class | net/minecraft/client/gui/components |
LivingEntityRenderer | 96 | 3 | class | net/minecraft/client/renderer/entity |
MobRenderer | 93 | 39 | class | net/minecraft/client/renderer/entity |
Particle | 84 | 4 | class | net/minecraft/client/particle |
SingleQuadParticle | 74 | 46 | class | net/minecraft/client/particle |
LivingEntityRenderState | 70 | 44 | class | net/minecraft/client/renderer/entity/state |
Item | 67 | 49 | class | net/minecraft/world/item |
BaseEntityBlock | 64 | 40 | class | net/minecraft/world/level/block |
StructurePiece | 63 | 8 | class | net/minecraft/world/level/levelgen/structure |
Entry | 63 | 2 | class | net/minecraft/client/gui/components |
Behavior | 58 | 53 | class | net/minecraft/world/entity/ai/behavior |
BlockEntity | 52 | 35 | class | net/minecraft/world/level/block/entity |
AgeableMob | 52 | 4 | class | net/minecraft/world/entity |
RenderLayer | 48 | 39 | class | net/minecraft/client/renderer/entity/layers |
NamedEntityFix | 47 | 47 | class | net/minecraft/util/datafix/fixes |
AgeableMobRenderer | 45 | 26 | class | net/minecraft/client/renderer/entity |
| root | descendants | direct | kind | where |
|---|---|---|---|---|
FeatureElement | 386 | 7 | interface | net/minecraft/world/flag |
ItemLike | 366 | 2 | interface | net/minecraft/world/level |
TabOrderedElement | 334 | 2 | interface | net/minecraft/client/gui/components |
GuiEventListener | 332 | 5 | interface | net/minecraft/client/gui/components/events |
Renderable | 269 | 6 | interface | net/minecraft/client/gui/components |
TypedInstance | 252 | 5 | interface | net/minecraft/core |
DebugValueSource | 248 | 3 | interface | net/minecraft/util/debug |
Packet | 240 | 229 | interface | net/minecraft/network/protocol |
SlotProvider | 231 | 2 | interface | net/minecraft/world/entity |
ContainerEventHandler | 224 | 3 | interface | net/minecraft/client/gui/components/events |
Nameable | 212 | 6 | interface | net/minecraft/world |
DataComponentGetter | 200 | 4 | interface | net/minecraft/core/component |
ItemOwner | 195 | 3 | interface | net/minecraft/world/entity |
UniquelyIdentifyable | 194 | 1 | interface | net/minecraft/world/level/entity |
EntityAccess | 193 | 1 | interface | net/minecraft/world/level/entity |
ScoreHolder | 193 | 1 | interface | net/minecraft/world/scores |
SyncedDataHolder | 193 | 1 | interface | net/minecraft/network/syncher |
Validatable | 174 | 22 | interface | net/minecraft/world/level/storage/loot |
LayoutElement | 173 | 4 | interface | net/minecraft/client/gui/layouts |
StringRepresentable | 165 | 164 | interface | net/minecraft/util |
NarrationSupplier | 146 | 3 | interface | net/minecraft/client/gui/narration |
Waypoint | 131 | 2 | interface | net/minecraft/world/waypoints |
Attackable | 126 | 2 | interface | net/minecraft/world/entity |
WaypointTransmitter | 125 | 1 | interface | net/minecraft/world/waypoints |
Leashable | 121 | 2 | interface | net/minecraft/world/entity |
ParticleProvider | 119 | 114 | interface | net/minecraft/client/particle |
Targeting | 116 | 2 | interface | net/minecraft/world/entity |
EquipmentUser | 115 | 1 | interface | net/minecraft/world/entity |
NarratableEntry | 103 | 2 | interface | net/minecraft/client/gui/narration |
RenderLayerParent | 97 | 1 | interface | net/minecraft/client/renderer/entity |
Rules: names, never code · how the system works, not how the code reads ·
newest version only · every backticked name passes tools/verify_names.py.