API reference / @jsprismarine/prismarine / content/ContentOptions
content/ContentOptions
Interfaces
ContentOptions
Defined in: packages/prismarine/src/content/ContentOptions.ts:31
How to build a ServerContent.
Properties
blockPalette?
readonlyoptionalblockPalette?:BlockPalette
Defined in: packages/prismarine/src/content/ContentOptions.ts:62
The palette the block runtime ids are assigned from. Defaults to the captured vanilla palette of 1477 blocks over 22079 states. A stack that declares fewer blocks than the palette holds cannot be flattened, so a test that loads a handful of blocks passes a palette of the same handful.
identifiers?
readonlyoptionalidentifiers?:IdentifierResolver
Defined in: packages/prismarine/src/content/ContentOptions.ts:51
Resolves the Java identifiers the stack references against Bedrock. Defaults to @jsprismarine/mapping's tables; a test replaces it to drive the totality check without them.
itemDefinitions?
readonlyoptionalitemDefinitions?:Iterable<Definition,any,any>
Defined in: packages/prismarine/src/content/ContentOptions.ts:68
The Java item definitions to resolve. Defaults to Java's committed table of 1658 items; Bedrock items/ files are loaded separately from the pack stack and their components stay on each type as Bedrock data.
load?
readonlyoptionalload?:PackLoader
Defined in: packages/prismarine/src/content/ContentOptions.ts:45
Replaces the pack loader, which is how a test builds content without touching the disk.
packs?
readonlyoptionalpacks?:PackStackRequest
Defined in: packages/prismarine/src/content/ContentOptions.ts:35
Which default stack members to include, used only when stack is absent.
seed?
readonlyoptionalseed?:bigint
Defined in: packages/prismarine/src/content/ContentOptions.ts:55
The world seed, which the loot sequences are keyed from.
stack?
readonlyoptionalstack?:PackStack
Defined in: packages/prismarine/src/content/ContentOptions.ts:33
The pack stack to load. When absent, PackStackRequest resolves the default one.
strict?
readonlyoptionalstrict?:boolean
Defined in: packages/prismarine/src/content/ContentOptions.ts:43
Fail the build on the first error instead of reporting it and carrying on.
The flag reaches the pack loader and both resolvers, so a bad pack, a block file naming a state its block does not have and an item component nothing implements all fail rather than loading short.
withheld?
readonlyoptionalwithheld?:WithheldContent
Defined in: packages/prismarine/src/content/ContentOptions.ts:74
Vanilla blocks, items and entity types to leave out of the build, which protocol-content: oldest asks for so the world holds nothing the oldest accepted release lacks. Nothing is left out when absent.
world?
readonlyoptionalworld?:ServerWorldSource
Defined in: packages/prismarine/src/content/ContentOptions.ts:53
The world the behavior families act through. Defaults to one that throws on every call.
Type Aliases
PackLoader
PackLoader = (
stack,options) =>LoadResult
Defined in: packages/prismarine/src/content/ContentOptions.ts:28
Loads a pack stack. load from @jsprismarine/packs is the default.
Parameters
stack
options
Returns
Functions
definitionOf()
definitionOf(
registry,identifier,data,pack?):Definition
Defined in: packages/prismarine/src/content/ContentOptions.ts:100
Builds one definition, for a test or for content that never passed through a pack.
Parameters
registry
"tags" | "blocks" | "items" | "entities" | "lootTables" | "tradeTables" | "spawnRules" | "recipes" | "biomes" | "features" | "featureRules" | "itemCatalog" | "customDimensions" | "dimensions" | "lootTablesJava" | "recipesJava" | "advancements" | "blockTransformers" | "enchantments" | "damageTypes" | "predicates" | "itemModifiers" | "slotSources" | "functions" | "dimensionTypes" | "paintingVariants" | "enchantmentProviders" | "bannerPatterns" | "instruments" | "jukeboxSongs" | "trimPatterns" | "trimMaterials" | "decoratedPotPatterns" | "catVariants" | "catSoundVariants" | "chickenVariants" | "chickenSoundVariants" | "cowVariants" | "cowSoundVariants" | "frogVariants" | "pigVariants" | "pigSoundVariants" | "wolfVariants" | "wolfSoundVariants" | "zombieNautilusVariants" | "sulfurCubeArchetypes" | "villagerTrades" | "tradeSets" | "trialSpawners" | "timelines" | "worldClocks" | "dispenseBehaviors" | "blockSoundSets" | "worldgen"
identifier
string
data
unknown
pack?
string = 'test'
Returns
definitionsOf()
definitionsOf(
partial):Definitions
Defined in: packages/prismarine/src/content/ContentOptions.ts:97
Fills in the registries a partial set leaves out, so a test names only the ones it cares about.
Parameters
partial
Partial<Definitions>
Returns
emptyDefinitions()
emptyDefinitions():
Definitions
Defined in: packages/prismarine/src/content/ContentOptions.ts:83
A Definitions object with every registry empty.
The registry list comes from @jsprismarine/packs, so a registry added there appears here without an edit.