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

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

The class hierarchy under Entity: each branch shows how many types descend from it Entity (192) LivingEntity (124) Mob (114) PathfinderMob (108) AmbientCreature (1) 3 with no subclasses Avatar (7) Player (4) Mannequin (1) ArmorStand Projectile (26) AbstractHurtingProjectile (8) AbstractWindCharge (2) Fireball (2) 2 with no subclasses ThrowableProjectile (8) ThrowableItemProjectile (7) AbstractArrow (3) 3 with no subclasses 4 with no subclasses VehicleEntity (15) AbstractMinecart (8) AbstractMinecartContainer (2) 5 with no subclasses AbstractBoat (5) AbstractChestBoat (2) 2 with no subclasses BlockAttachedEntity (6) HangingEntity (3) ItemFrame (1) Painting 2 with no subclasses Display (3) 3 with no subclasses 13 with no subclasses
The 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

The class hierarchy under Block: each branch shows how many types descend from it Block (297) BaseEntityBlock (64) AbstractSkullBlock (7) WallSkullBlock (3) SkullBlock (2) AbstractChestBlock (5) ChestBlock (3) EnderChestBlock SignBlock (4) 4 with no subclasses AbstractFurnaceBlock (3) 3 with no subclasses AbstractBannerBlock (2) 2 with no subclasses CopperGolemStatueBlock (1) WeatheringCopperGolemStatueBlock DispenserBlock (1) DropperBlock SculkSensorBlock (1) CalibratedSculkSensorBlock 32 with no subclasses VegetationBlock (36) CropBlock (4) 4 with no subclasses DoublePlantBlock (4) 4 with no subclasses DryVegetationBlock (2) 2 with no subclasses FlowerBlock (2) 2 with no subclasses SaplingBlock (1) MangrovePropaguleBlock 18 with no subclasses HorizontalDirectionalBlock (21) FaceAttachedHorizontalDirectionalBlock (3) 3 with no subclasses AbstractBedBlock (2) 2 with no subclasses DiodeBlock (2) 2 with no subclasses TrapDoorBlock (1) WeatheringCopperTrapDoorBlock 9 with no subclasses GrowingPlantBlock (10) GrowingPlantBodyBlock (4) 4 with no subclasses GrowingPlantHeadBlock (4) 4 with no subclasses HalfTransparentBlock (9) TransparentBlock (4) WaterloggedTransparentBlock (1) 2 with no subclasses IceBlock (1) FrostedIceBlock 2 with no subclasses DirectionalBlock (7) RodBlock (3) LightningRodBlock (1) EndRodBlock 3 with no subclasses BaseCoralPlantTypeBlock (6) BaseCoralFanBlock (3) BaseCoralWallFanBlock (1) CoralFanBlock 2 with no subclasses FallingBlock (5) ColoredFallingBlock (1) SandBlock 3 with no subclasses BaseTorchBlock (4) RedstoneTorchBlock (1) RedstoneWallTorchBlock TorchBlock (1) WallTorchBlock CrossCollisionBlock (4) IronBarsBlock (2) 2 with no subclasses FenceBlock LeavesBlock (4) FallingParticlesLeavesBlock (3) TintedParticleLeavesBlock (1) UntintedParticleLeavesBlock AbstractCauldronBlock (3) 3 with no subclasses BaseRailBlock (3) 3 with no subclasses MultifaceBlock (3) MultifaceSpreadeableBlock (2) 2 with no subclasses RotatedPillarBlock (3) ChainBlock (1) WeatheringCopperChainBlock HayBlock SnowyBlock (3) SpreadingSnowyBlock (2) 2 with no subclasses AbstractCandleBlock (2) 2 with no subclasses AmethystBlock (2) 2 with no subclasses BaseFireBlock (2) 2 with no subclasses BasePressurePlateBlock (2) 2 with no subclasses SpeleothemBlock (2) 2 with no subclasses CarpetBlock (1) WoolCarpetBlock CopperBulbBlock (1) WeatheringCopperBulbBlock CraftingTableBlock (1) SmithingTableBlock DoorBlock (1) WeatheringCopperDoorBlock DropExperienceBlock (1) SculkBlock InfestedBlock (1) InfestedRotatedPillarBlock LanternBlock (1) WeatheringLanternBlock PipeBlock (1) ChorusPlantBlock SlabBlock (1) WeatheringCopperSlabBlock StairBlock (1) WeatheringCopperStairBlock 61 with no subclasses
The 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

The class hierarchy under Item: each branch shows how many types descend from it Item (67) BlockItem (9) StandingAndWallBlockItem (3) 3 with no subclasses 5 with no subclasses PotionItem (3) ThrowablePotionItem (2) 2 with no subclasses ArrowItem (2) 2 with no subclasses ProjectileWeaponItem (2) 2 with no subclasses BucketItem (1) MobBucketItem HangingEntityItem (1) ItemFrameItem 43 with no subclasses
The 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

The class hierarchy under Screen: each branch shows how many types descend from it Screen (161) AbstractContainerScreen (27) AbstractRecipeBookScreen (6) AbstractFurnaceScreen (3) 2 with no subclasses AbstractMountInventoryScreen (2) 2 with no subclasses ItemCombinerScreen (2) 2 with no subclasses 14 with no subclasses RealmsScreen (27) AbstractRealmsCodeScreen (3) 3 with no subclasses RealmsLongRunningMcoTaskScreen (1) RealmsLongRunningMcoConnectTaskScreen 21 with no subclasses OptionsSubScreen (11) 11 with no subclasses ConfirmScreen (6) ConfirmLinkScreen (1) PrivacyConfirmLinkScreen 4 with no subclasses DialogScreen (5) ButtonListDialogScreen (3) 3 with no subclasses SimpleDialogScreen AbstractReportScreen (3) 3 with no subclasses WarningScreen (3) 3 with no subclasses AbstractCommandBlockEditScreen (2) 2 with no subclasses AbstractGameRulesScreen (2) 2 with no subclasses AbstractSignEditScreen (2) 2 with no subclasses BookViewScreen (1) LecternScreen ChatScreen (1) InBedChatScreen 59 with no subclasses
The 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.

rootdescendantsdirectkindwhere
BlockBehaviour2981classnet/minecraft/world/level/block/state
Block29792classnet/minecraft/world/level/block
Goal20299classnet/minecraft/world/entity/ai/goal
Entity19218classnet/minecraft/world/entity
Model17014classnet/minecraft/client/model
AbstractContainerEventHandler1621classnet/minecraft/client/gui/components/events
Screen16171classnet/minecraft/client/gui/screens
EntityModel15371classnet/minecraft/client/model
EntityRenderer13328classnet/minecraft/client/renderer/entity
LivingEntity1243classnet/minecraft/world/entity
Mob1145classnet/minecraft/world/entity
PathfinderMob1085classnet/minecraft/world/entity
NamespacedSchema107107classnet/minecraft/util/datafix/schemas
EntityRenderState9923classnet/minecraft/client/renderer/entity/state
AbstractWidget9912classnet/minecraft/client/gui/components
LivingEntityRenderer963classnet/minecraft/client/renderer/entity
MobRenderer9339classnet/minecraft/client/renderer/entity
Particle844classnet/minecraft/client/particle
SingleQuadParticle7446classnet/minecraft/client/particle
LivingEntityRenderState7044classnet/minecraft/client/renderer/entity/state
Item6749classnet/minecraft/world/item
BaseEntityBlock6440classnet/minecraft/world/level/block
StructurePiece638classnet/minecraft/world/level/levelgen/structure
Entry632classnet/minecraft/client/gui/components
Behavior5853classnet/minecraft/world/entity/ai/behavior
BlockEntity5235classnet/minecraft/world/level/block/entity
AgeableMob524classnet/minecraft/world/entity
RenderLayer4839classnet/minecraft/client/renderer/entity/layers
NamedEntityFix4747classnet/minecraft/util/datafix/fixes
AgeableMobRenderer4526classnet/minecraft/client/renderer/entity
rootdescendantsdirectkindwhere
FeatureElement3867interfacenet/minecraft/world/flag
ItemLike3662interfacenet/minecraft/world/level
TabOrderedElement3342interfacenet/minecraft/client/gui/components
GuiEventListener3325interfacenet/minecraft/client/gui/components/events
Renderable2696interfacenet/minecraft/client/gui/components
TypedInstance2525interfacenet/minecraft/core
DebugValueSource2483interfacenet/minecraft/util/debug
Packet240229interfacenet/minecraft/network/protocol
SlotProvider2312interfacenet/minecraft/world/entity
ContainerEventHandler2243interfacenet/minecraft/client/gui/components/events
Nameable2126interfacenet/minecraft/world
DataComponentGetter2004interfacenet/minecraft/core/component
ItemOwner1953interfacenet/minecraft/world/entity
UniquelyIdentifyable1941interfacenet/minecraft/world/level/entity
EntityAccess1931interfacenet/minecraft/world/level/entity
ScoreHolder1931interfacenet/minecraft/world/scores
SyncedDataHolder1931interfacenet/minecraft/network/syncher
Validatable17422interfacenet/minecraft/world/level/storage/loot
LayoutElement1734interfacenet/minecraft/client/gui/layouts
StringRepresentable165164interfacenet/minecraft/util
NarrationSupplier1463interfacenet/minecraft/client/gui/narration
Waypoint1312interfacenet/minecraft/world/waypoints
Attackable1262interfacenet/minecraft/world/entity
WaypointTransmitter1251interfacenet/minecraft/world/waypoints
Leashable1212interfacenet/minecraft/world/entity
ParticleProvider119114interfacenet/minecraft/client/particle
Targeting1162interfacenet/minecraft/world/entity
EquipmentUser1151interfacenet/minecraft/world/entity
NarratableEntry1032interfacenet/minecraft/client/gui/narration
RenderLayerParent971interfacenet/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.