API reference / @jsprismarine/prismarine / content/ServerContent
content/ServerContent
Interfaces
ServerContent
Defined in: packages/prismarine/src/content/ServerContent.ts:147
Every content registry the server runs on.
Built once at startup and replaced whole by a reload. Hold a key or a Holder, never a numeric id: ids are positional and a rebuild renumbers them from zero.
Properties
advancements
readonlyadvancements:AdvancementEngine
Defined in: packages/prismarine/src/content/ServerContent.ts:195
Java's advancements, with their trigger graph built.
biomes
readonlybiomes:Registry<Definition>
Defined in: packages/prismarine/src/content/ServerContent.ts:211
Bedrock's biome definitions, unparsed, keyed by identifier.
blocks
readonlyblocks:ServerContentBlocks
Defined in: packages/prismarine/src/content/ServerContent.ts:165
blockTransformers
readonlyblockTransformers:BlockTransformerRegistry
Defined in: packages/prismarine/src/content/ServerContent.ts:201
Java's block_transformer registry: what an axe strips, a shovel paths and a hoe tills.
contentFingerprint
readonlycontentFingerprint:string
Defined in: packages/prismarine/src/content/ServerContent.ts:149
SHA-256 of the effective definition files and built-in content tables used by this build.
definitions
readonlydefinitions:Definitions
Defined in: packages/prismarine/src/content/ServerContent.ts:160
The composed pack stack, before any domain resolved it.
diagnostics
readonlydiagnostics: readonlyDiagnostic[]
Defined in: packages/prismarine/src/content/ServerContent.ts:162
Everything the load and every resolve reported, in build order.
enchantments
readonlyenchantments:EnchantmentRegistry
Defined in: packages/prismarine/src/content/ServerContent.ts:197
Java's enchantments and their effect components.
entities
readonlyentities:ServerContentEntities
Defined in: packages/prismarine/src/content/ServerContent.ts:167
equipmentDifficulty
readonlyequipmentDifficulty:RegionalDifficultyView
Defined in: packages/prismarine/src/content/ServerContent.ts:193
The difficulty ServerContent.equipmentLoot's random_regional_difficulty_chance and random_difficulty_chance read. A spawn roll sets the place it rolls for through RegionalDifficultyView.during; any other roll sees normal difficulty in a fully ramped region.
equipmentLoot
readonlyequipmentLoot:LootRegistry
Defined in: packages/prismarine/src/content/ServerContent.ts:186
Bedrock's loot tables, compiled on first roll, which is what a mob spawns holding: minecraft:equipment.table names one of these.
Separate from ServerContent.loot because a registry reads one dialect, and these are the behavior pack's own files rather than a datapack's.
featureRules
readonlyfeatureRules:Registry<Definition>
Defined in: packages/prismarine/src/content/ServerContent.ts:215
Bedrock's feature rules, unparsed, keyed by identifier.
features
readonlyfeatures:Registry<Definition>
Defined in: packages/prismarine/src/content/ServerContent.ts:213
Bedrock's feature definitions, unparsed, keyed by identifier.
items
readonlyitems:ServerContentItems
Defined in: packages/prismarine/src/content/ServerContent.ts:166
javaTarget
readonlyjavaTarget:JavaDataTarget
Defined in: packages/prismarine/src/content/ServerContent.ts:158
The Java release the stack's datapacks were loaded for. A level records its data version in level.dat and refuses to open under an older one.
loot
readonlyloot:LootRegistry
Defined in: packages/prismarine/src/content/ServerContent.ts:177
Java's loot tables, compiled on first roll.
materialReductions
readonlymaterialReductions: readonlyMaterialReduction[]
Defined in: packages/prismarine/src/content/ServerContent.ts:175
The behavior packs' material reduction recipes, in Bedrock's own item names. They break an item into Education Edition elements, which Java has no items for, so they stay out of recipes and only the crafting packet carries them.
recipes
readonlyrecipes:RecipeBook
Defined in: packages/prismarine/src/content/ServerContent.ts:169
Java's recipe grammar, with net ids assigned in registry order.
scriptComponents?
readonlyoptionalscriptComponents?:ScriptComponentBridge
Defined in: packages/prismarine/src/content/ServerContent.ts:207
Where the custom components the content's blocks and items name send their hooks, which behavior pack scripts bind once they have registered the components. Absent in content built without it, which raises no such hook.
spawnRules
readonlyspawnRules: readonlySpawnRule[]
Defined in: packages/prismarine/src/content/ServerContent.ts:199
Bedrock's spawn rules, one per parsed spawn_rules/ file.
strict
readonlystrict:boolean
Defined in: packages/prismarine/src/content/ServerContent.ts:151
Whether invalid content made the build fail instead of being reported as diagnostics.
structures
readonlystructures:Registry<Definition>
Defined in: packages/prismarine/src/content/ServerContent.ts:224
Structure definitions, unparsed.
Empty for now: the templates are NBT rather than JSON and @jsprismarine/packs routes no structure registry yet, so the world subsystem reads them itself. The registry is declared so the seam does not move once it does.
tags
readonlytags:ContentTags
Defined in: packages/prismarine/src/content/ServerContent.ts:226
Every tag file in the stack, merged by Java Edition's rule and split by tagged registry.
tradeTables
readonlytradeTables:ReadonlyMap<string,TradeTable>
Defined in: packages/prismarine/src/content/ServerContent.ts:209
Bedrock's trade tables, keyed by the pack-relative path a villager names.
withheld
readonlywithheld:WithheldContent
Defined in: packages/prismarine/src/content/ServerContent.ts:153
The vanilla content the build left out, because protocol-content holds the world to an older release.
world
readonlyworld:ContentWorldViews
Defined in: packages/prismarine/src/content/ServerContent.ts:164
The nine world interfaces the content packages were built against.
ServerContentBlocks
Defined in: packages/prismarine/src/content/ServerContent.ts:92
The resolved block domain.
Properties
behaviors
readonlybehaviors:BehaviorRegistry<BlockHooks>
Defined in: packages/prismarine/src/content/ServerContent.ts:102
The 49 vanilla behavior families, plus whatever a plugin added before the build.
palette
readonlypalette:BlockPalette
Defined in: packages/prismarine/src/content/ServerContent.ts:94
The dense runtime id per state, which indexes ServerContentBlocks.table.
states
readonlystates: readonlyBlockState[]
Defined in: packages/prismarine/src/content/ServerContent.ts:98
One entry per palette state, in runtime id order.
table
readonlytable:BlockTable
Defined in: packages/prismarine/src/content/ServerContent.ts:100
The flattened hot columns, each a typed array indexed by runtime id.
types
readonlytypes:ReadonlyMap<string,BlockType>
Defined in: packages/prismarine/src/content/ServerContent.ts:96
One resolved type per block identifier.
ServerContentEntities
Defined in: packages/prismarine/src/content/ServerContent.ts:120
The resolved entity domain.
Properties
brains
readonlybrains:BrainMobRegistry
Defined in: packages/prismarine/src/content/ServerContent.ts:128
The twenty Java brain mobs, whose behavior has no data form in either edition.
components
readonlycomponents:EntityComponentRegistry
Defined in: packages/prismarine/src/content/ServerContent.ts:126
The component registry, with all 170 goals registered ahead of the reference components.
javaNavigation?
readonlyoptionaljavaNavigation?:Readonly<Record<string,JavaEntityNavigation>>
Defined in: packages/prismarine/src/content/ServerContent.ts:132
Java's navigation classes, path costs, and pushability for each mob.
javaStats?
readonlyoptionaljavaStats?:Readonly<Record<string,JavaEntityStats>>
Defined in: packages/prismarine/src/content/ServerContent.ts:130
Java's attribute suppliers for the stats the server decides.
packData?
readonlyoptionalpackData?:ReadonlyMap<string,unknown>
Defined in: packages/prismarine/src/content/ServerContent.ts:137
Each entity file as its pack wrote it, before the Java overlays, by identifier: what a script's entity components read, as on a Bedrock Dedicated Server.
registry
readonlyregistry:Registry<EntityType>
Defined in: packages/prismarine/src/content/ServerContent.ts:122
The registry, with a dense id per entity identifier.
types
readonlytypes:EntityTypes
Defined in: packages/prismarine/src/content/ServerContent.ts:124
The loaded types, which also spawn instances.
ServerContentItems
Defined in: packages/prismarine/src/content/ServerContent.ts:106
The resolved item domain.
Properties
behaviors
readonlybehaviors:BehaviorRegistry<ItemHooks>
Defined in: packages/prismarine/src/content/ServerContent.ts:116
The 47 vanilla behavior families.
facts
readonlyfacts:ItemFacts
Defined in: packages/prismarine/src/content/ServerContent.ts:114
The flattened hot columns, each a typed array indexed by the registry id.
registry
readonlyregistry:ItemRegistry
Defined in: packages/prismarine/src/content/ServerContent.ts:108
The registry, with a dense id per item identifier.
tags
readonlytags:BedrockItemTags
Defined in: packages/prismarine/src/content/ServerContent.ts:112
Bedrock tags from the captured catalog and loaded item definitions.
types
readonlytypes:ReadonlyMap<string,ItemType>
Defined in: packages/prismarine/src/content/ServerContent.ts:110
One resolved type per item identifier.
Functions
buildServerContent()
buildServerContent(
options?):ServerContent
Defined in: packages/prismarine/src/content/ServerContent.ts:365
Builds every content registry from a pack stack.
The order is forced by what each step needs. The behavior families are registered before their domain resolves, because resolution attaches them; the item factory is deferred and bound afterwards, because the families are registered before the item registry they build stacks from exists; and the goals are registered before the reference entity components, because the component registration skips names that are already taken and the goals are the implementations the server wants.
Parameters
options?
ContentOptions = {}
Returns
Throws
In strict mode, when the pack stack reports an error.
Throws
In strict mode, when a Java identifier the stack references has no Bedrock mapping and no reviewed loss entry.
Throws
In strict mode, when a block definition does not resolve.
Throws
In strict mode, when a loot table carries grammar this server has no reviewed entry for.
rebindServerContentSeed()
rebindServerContentSeed(
snapshot,seed):ServerContent
Defined in: packages/prismarine/src/content/ServerContent.ts:734
Rebinds the seed-dependent loot streams on a snapshot of the resolved content registries.
Blocks, items, entities, recipes, behaviors, and world views stay shared with the snapshot. Loot registries are rebuilt because their named random streams are keyed by the current world seed; compiling them here also preserves strict validation before the server starts.
Parameters
snapshot
Resolved content captured with a rebindable world source.
seed
bigint
The seed used for this server's loot sequences.
Returns
A content object that reuses the snapshot registries and owns fresh loot streams.