API reference / @jsprismarine/prismarine / content/world/views
content/world/views
Interfaces
ContentWorldViews
Defined in: packages/prismarine/src/content/world/views.ts:104
The nine content world interfaces, all backed by one adapter.
Properties
blockWorld
readonlyblockWorld:ServerBlockWorld
Defined in: packages/prismarine/src/content/world/views.ts:106
BlockWorld for @jsprismarine/block-behaviors, which resolves a dimension per event.
engineWorld
readonlyengineWorld:WorldAccess
Defined in: packages/prismarine/src/content/world/views.ts:112
WorldAccess for @jsprismarine/engine-systems, in the default dimension.
itemActions
readonlyitemActions:WorldActions
Defined in: packages/prismarine/src/content/world/views.ts:108
WorldActions for @jsprismarine/item-behaviors, resolved per interaction.
lightView
readonlylightView:BlockLightView
Defined in: packages/prismarine/src/content/world/views.ts:110
BlockLightView for @jsprismarine/lighting, in the default dimension.
spawnWorld
readonlyspawnWorld:SpawnWorld
Defined in: packages/prismarine/src/content/world/views.ts:114
SpawnWorld for @jsprismarine/spawning, in the default dimension.
Methods
actuator()
actuator(
entity):EntityActuator
Defined in: packages/prismarine/src/content/world/views.ts:118
EntityActuator for @jsprismarine/entities, resolved per entity.
Parameters
entity
Returns
brainWorld()
brainWorld():
BrainWorld
Defined in: packages/prismarine/src/content/world/views.ts:120
BrainWorld for @jsprismarine/entity-brains.
Returns
featureWorld()
featureWorld(
chunkX,chunkZ):FeatureWorld
Defined in: packages/prismarine/src/content/world/views.ts:122
FeatureWorld for @jsprismarine/features, for one chunk being decorated.
Parameters
chunkX
number
chunkZ
number
Returns
goalWorld()
goalWorld(
entity):GoalWorld|undefined
Defined in: packages/prismarine/src/content/world/views.ts:116
GoalWorld for @jsprismarine/entity-goals, resolved per entity.
Parameters
entity
Returns
GoalWorld | undefined
ServerBlockWorld
Defined in: packages/prismarine/src/content/world/views.ts:78
BlockWorld as the server reads it. The block behaviors name a world by its dimension, which means the default level's; the server's own callers pass the level of a world of another, so a block placed in that level is written there.
Extends
Methods
at()
at(
dimension,level?):WorldActions
Defined in: packages/prismarine/src/content/world/views.ts:84
The actions for one world.
Parameters
dimension
string
The namespaced dimension identifier.
level?
string
The level's name, or undefined for the default level.
Returns
Overrides
notifyNeighbors()
notifyNeighbors(
at,previous,dimension,level?):void
Defined in: packages/prismarine/src/content/world/views.ts:100
Tells the six neighbors of a block that it changed, with what it replaced; see ContentBlockAccess.notifyNeighbors.
Parameters
at
The block's position.
previous
The block the change replaced.
dimension
string
The namespaced dimension identifier.
level?
string
The level's name, or undefined for the default level.
Returns
void
updateShape()
updateShape(
at,dimension,level?):void
Defined in: packages/prismarine/src/content/world/views.ts:91
Settles one block against its neighbors; see ContentBlockAccess.updateShape.
Parameters
at
The block's position.
dimension
string
The namespaced dimension identifier.
level?
string
The level's name, or undefined for the default level.
Returns
void
Type Aliases
ContentLookup
ContentLookup = () =>
ServerContent
Defined in: packages/prismarine/src/content/world/views.ts:71
Reads the built content.
The world views and the content build need each other: a behavior family is registered before the block types exist, and it reads a block's properties out of those types once it runs. The lookup closes that loop by deferring the read to hook time, the same way @jsprismarine/item-behaviors's deferredItemFactory does.
Returns
Functions
contentBlockLight()
contentBlockLight(
content,block): {lightDampening:number;lightEmission:number; } |undefined
Defined in: packages/prismarine/src/content/world/views.ts:174
The light a block state gives off and swallows, from the content's block table, which holds a pack's blocks beside the vanilla ones.
Parameters
content
block
Returns
{ lightDampening: number; lightEmission: number; } | undefined
Undefined for a state the content's palette does not have.
contentWorldViews()
contentWorldViews(
world,content,defaultDimension?):ContentWorldViews
Defined in: packages/prismarine/src/content/world/views.ts:126
Builds every content world interface over one adapter source.
Parameters
world
content
defaultDimension?
string = 'minecraft:overworld'
Returns
flammabilityOf()
flammabilityOf(
content,block):BlockFlammability|undefined
Defined in: packages/prismarine/src/content/world/views.ts:205
Reads the active state's Bedrock flammability component, including permutations: the odds the fire rule reads for a block, which the parity suite compares with Java's.
Parameters
content
block
Returns
BlockFlammability | undefined