Skip to content

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 ​

readonly advancements: AdvancementEngine

Defined in: packages/prismarine/src/content/ServerContent.ts:195

Java's advancements, with their trigger graph built.

biomes ​

readonly biomes: Registry<Definition>

Defined in: packages/prismarine/src/content/ServerContent.ts:211

Bedrock's biome definitions, unparsed, keyed by identifier.

blocks ​

readonly blocks: ServerContentBlocks

Defined in: packages/prismarine/src/content/ServerContent.ts:165

blockTransformers ​

readonly blockTransformers: 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 ​

readonly contentFingerprint: 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 ​

readonly definitions: Definitions

Defined in: packages/prismarine/src/content/ServerContent.ts:160

The composed pack stack, before any domain resolved it.

diagnostics ​

readonly diagnostics: readonly Diagnostic[]

Defined in: packages/prismarine/src/content/ServerContent.ts:162

Everything the load and every resolve reported, in build order.

enchantments ​

readonly enchantments: EnchantmentRegistry

Defined in: packages/prismarine/src/content/ServerContent.ts:197

Java's enchantments and their effect components.

entities ​

readonly entities: ServerContentEntities

Defined in: packages/prismarine/src/content/ServerContent.ts:167

equipmentDifficulty ​

readonly equipmentDifficulty: 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 ​

readonly equipmentLoot: 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 ​

readonly featureRules: Registry<Definition>

Defined in: packages/prismarine/src/content/ServerContent.ts:215

Bedrock's feature rules, unparsed, keyed by identifier.

features ​

readonly features: Registry<Definition>

Defined in: packages/prismarine/src/content/ServerContent.ts:213

Bedrock's feature definitions, unparsed, keyed by identifier.

items ​

readonly items: ServerContentItems

Defined in: packages/prismarine/src/content/ServerContent.ts:166

javaTarget ​

readonly javaTarget: 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 ​

readonly loot: LootRegistry

Defined in: packages/prismarine/src/content/ServerContent.ts:177

Java's loot tables, compiled on first roll.

materialReductions ​

readonly materialReductions: readonly MaterialReduction[]

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 ​

readonly recipes: RecipeBook

Defined in: packages/prismarine/src/content/ServerContent.ts:169

Java's recipe grammar, with net ids assigned in registry order.

scriptComponents? ​

readonly optional scriptComponents?: 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 ​

readonly spawnRules: readonly SpawnRule[]

Defined in: packages/prismarine/src/content/ServerContent.ts:199

Bedrock's spawn rules, one per parsed spawn_rules/ file.

strict ​

readonly strict: boolean

Defined in: packages/prismarine/src/content/ServerContent.ts:151

Whether invalid content made the build fail instead of being reported as diagnostics.

structures ​

readonly structures: 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 ​

readonly tags: 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 ​

readonly tradeTables: 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 ​

readonly withheld: 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 ​

readonly world: 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 ​

readonly behaviors: 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 ​

readonly palette: BlockPalette

Defined in: packages/prismarine/src/content/ServerContent.ts:94

The dense runtime id per state, which indexes ServerContentBlocks.table.

states ​

readonly states: readonly BlockState[]

Defined in: packages/prismarine/src/content/ServerContent.ts:98

One entry per palette state, in runtime id order.

table ​

readonly table: BlockTable

Defined in: packages/prismarine/src/content/ServerContent.ts:100

The flattened hot columns, each a typed array indexed by runtime id.

types ​

readonly types: 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 ​

readonly brains: 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 ​

readonly components: EntityComponentRegistry

Defined in: packages/prismarine/src/content/ServerContent.ts:126

The component registry, with all 170 goals registered ahead of the reference components.

javaNavigation? ​

readonly optional javaNavigation?: 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? ​

readonly optional javaStats?: Readonly<Record<string, JavaEntityStats>>

Defined in: packages/prismarine/src/content/ServerContent.ts:130

Java's attribute suppliers for the stats the server decides.

packData? ​

readonly optional packData?: 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 ​

readonly registry: Registry<EntityType>

Defined in: packages/prismarine/src/content/ServerContent.ts:122

The registry, with a dense id per entity identifier.

types ​

readonly types: 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 ​

readonly behaviors: BehaviorRegistry<ItemHooks>

Defined in: packages/prismarine/src/content/ServerContent.ts:116

The 47 vanilla behavior families.

facts ​

readonly facts: ItemFacts

Defined in: packages/prismarine/src/content/ServerContent.ts:114

The flattened hot columns, each a typed array indexed by the registry id.

registry ​

readonly registry: ItemRegistry

Defined in: packages/prismarine/src/content/ServerContent.ts:108

The registry, with a dense id per item identifier.

tags ​

readonly tags: BedrockItemTags

Defined in: packages/prismarine/src/content/ServerContent.ts:112

Bedrock tags from the captured catalog and loaded item definitions.

types ​

readonly types: 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 ​

ServerContent

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 ​

ServerContent

Resolved content captured with a rebindable world source.

seed ​

bigint

The seed used for this server's loot sequences.

Returns ​

ServerContent

A content object that reuses the snapshot registries and owns fresh loot streams.