Skip to content

API reference / @jsprismarine/script-host / host/worldsystem/seam

host/worldsystem/seam ​

Interfaces ​

ScriptBiome ​

Defined in: script-host/src/host/worldsystem/seam.ts:42

A biome as BiomeType reads it.

Properties ​

id ​

readonly id: string

Defined in: script-host/src/host/worldsystem/seam.ts:43

tags ​

readonly tags: readonly string[]

Defined in: script-host/src/host/worldsystem/seam.ts:44


ScriptChunkArea ​

Defined in: script-host/src/host/worldsystem/seam.ts:58

A rectangle of chunks, inclusive, by chunk coordinates.

Properties ​

maxX ​

readonly maxX: number

Defined in: script-host/src/host/worldsystem/seam.ts:60

maxZ ​

readonly maxZ: number

Defined in: script-host/src/host/worldsystem/seam.ts:62

minX ​

readonly minX: number

Defined in: script-host/src/host/worldsystem/seam.ts:59

minZ ​

readonly minZ: number

Defined in: script-host/src/host/worldsystem/seam.ts:61


ScriptExplosion ​

Defined in: script-host/src/host/worldsystem/seam.ts:48

An explosion a script sets off, as ExplosionOptions describes it.

Properties ​

allowUnderwater ​

readonly allowUnderwater: boolean

Defined in: script-host/src/host/worldsystem/seam.ts:52

breaksBlocks ​

readonly breaksBlocks: boolean

Defined in: script-host/src/host/worldsystem/seam.ts:50

causesFire ​

readonly causesFire: boolean

Defined in: script-host/src/host/worldsystem/seam.ts:51

radius ​

readonly radius: number

Defined in: script-host/src/host/worldsystem/seam.ts:49

source? ​

readonly optional source?: string

Defined in: script-host/src/host/worldsystem/seam.ts:54

The entity answerable for it.


ScriptFogLayer ​

Defined in: script-host/src/host/worldsystem/seam.ts:83

One layer of a player's fog stack: a fog definition's id and the tag a script gave it.

Properties ​

fogId ​

readonly fogId: string

Defined in: script-host/src/host/worldsystem/seam.ts:84

tag ​

readonly tag: string

Defined in: script-host/src/host/worldsystem/seam.ts:85


ScriptLight ​

Defined in: script-host/src/host/worldsystem/seam.ts:34

The light at a block, as getLightLevel and getSkyLightLevel read it, 0 to 15.

Properties ​

level ​

readonly level: number

Defined in: script-host/src/host/worldsystem/seam.ts:36

The brightest of the block light and the sky light there; 0 inside an opaque block.

sky ​

readonly sky: number

Defined in: script-host/src/host/worldsystem/seam.ts:38

The sky light there, read as if the block let it through, as BDS reads it.


ScriptLootPlace ​

Defined in: script-host/src/host/worldsystem/seam.ts:89

Where loot is rolled, for the conditions and functions that read the place.

Properties ​

dimension ​

readonly dimension: string

Defined in: script-host/src/host/worldsystem/seam.ts:90

location ​

readonly location: ScriptVector3

Defined in: script-host/src/host/worldsystem/seam.ts:91


ScriptMusic ​

Defined in: script-host/src/host/worldsystem/seam.ts:17

A track world.playMusic or queueMusic starts for every player.

Properties ​

fade ​

readonly fade: number

Defined in: script-host/src/host/worldsystem/seam.ts:21

Seconds the track fades in over.

loop ​

readonly loop: boolean

Defined in: script-host/src/host/worldsystem/seam.ts:22

queue ​

readonly queue: boolean

Defined in: script-host/src/host/worldsystem/seam.ts:24

Whether it waits for the playing track to end, as queueMusic does.

track ​

readonly track: string

Defined in: script-host/src/host/worldsystem/seam.ts:18

volume ​

readonly volume: number

Defined in: script-host/src/host/worldsystem/seam.ts:19


ScriptTickingArea ​

Defined in: script-host/src/host/worldsystem/seam.ts:66

One of the scripts' ticking areas, as the world keeps it.

Properties ​

chunks ​

readonly chunks: ScriptChunkArea

Defined in: script-host/src/host/worldsystem/seam.ts:69

dimension ​

readonly dimension: string

Defined in: script-host/src/host/worldsystem/seam.ts:68

identifier ​

readonly identifier: string

Defined in: script-host/src/host/worldsystem/seam.ts:67

loaded ​

readonly loaded: boolean

Defined in: script-host/src/host/worldsystem/seam.ts:71

Whether every chunk it covers is loaded.


ScriptTimeMarker ​

Defined in: script-host/src/host/worldsystem/seam.ts:75

A time marker a script added to the overworld's clock.

Properties ​

name ​

readonly name: string

Defined in: script-host/src/host/worldsystem/seam.ts:76

period? ​

readonly optional period?: number

Defined in: script-host/src/host/worldsystem/seam.ts:79

Ticks between two of its times; absent for a marker that comes once.

time ​

readonly time: number

Defined in: script-host/src/host/worldsystem/seam.ts:77


ScriptWorldSystem ​

Defined in: script-host/src/host/worldsystem/seam.ts:95

The world and system state the world and system members of a world's scripts reach.

Methods ​

absoluteTime() ​

absoluteTime(): number

Defined in: script-host/src/host/worldsystem/seam.ts:97

The world's time in ticks since it began, which /time set writes and every dimension shares.

Returns ​

number

addTickingArea() ​

addTickingArea(identifier, dimension, chunks): void

Defined in: script-host/src/host/worldsystem/seam.ts:147

Adds a ticking area over the chunks a block box covers, which starts them loading.

Parameters ​
identifier ​

string

dimension ​

string

chunks ​

ScriptChunkArea

Returns ​

void

addTimeMarker() ​

addTimeMarker(marker): void

Defined in: script-host/src/host/worldsystem/seam.ts:167

Parameters ​
marker ​

ScriptTimeMarker

Returns ​

void

allowCheats() ​

allowCheats(): boolean

Defined in: script-host/src/host/worldsystem/seam.ts:109

Returns ​

boolean

biome() ​

biome(dimension, location): string | undefined

Defined in: script-host/src/host/worldsystem/seam.ts:122

The biome at a location, or undefined when its chunk is not loaded.

Parameters ​
dimension ​

string

location ​

ScriptVector3

Returns ​

string | undefined

biomes() ​

biomes(): readonly ScriptBiome[]

Defined in: script-host/src/host/worldsystem/seam.ts:124

Every biome the world knows, with its tags.

Returns ​

readonly ScriptBiome[]

blockKind() ​

blockKind(typeId): ScriptBlockKind

Defined in: script-host/src/host/worldsystem/seam.ts:118

What a block is to a search or a ray, by its type.

Parameters ​
typeId ​

string

Returns ​

ScriptBlockKind

blockTags() ​

blockTags(typeId): readonly string[]

Defined in: script-host/src/host/worldsystem/seam.ts:174

A block type's Bedrock tags, as a block filter's tags match them.

Parameters ​
typeId ​

string

Returns ​

readonly string[]

clockPaused() ​

clockPaused(): boolean

Defined in: script-host/src/host/worldsystem/seam.ts:163

Whether a script paused the overworld's clock.

Returns ​

boolean

defaultSpawn() ​

defaultSpawn(): ScriptVector3

Defined in: script-host/src/host/worldsystem/seam.ts:102

The world's spawn, in whole blocks.

Returns ​

ScriptVector3

difficulty() ​

difficulty(): ScriptDifficulty

Defined in: script-host/src/host/worldsystem/seam.ts:99

Returns ​

ScriptDifficulty

entityBox() ​

entityBox(id): { max: ScriptVector3; min: ScriptVector3; } | undefined

Defined in: script-host/src/host/worldsystem/seam.ts:131

An entity's collision box, or undefined for one that is gone.

Parameters ​
id ​

string

Returns ​

{ max: ScriptVector3; min: ScriptVector3; } | undefined

explode() ​

explode(dimension, location, explosion): void

Defined in: script-host/src/host/worldsystem/seam.ts:136

Parameters ​
dimension ​

string

location ​

ScriptVector3

explosion ​

ScriptExplosion

Returns ​

void

findBiome() ​

findBiome(dimension, biome, from): ScriptVector3 | undefined

Defined in: script-host/src/host/worldsystem/seam.ts:129

The nearest location of a biome the world's generator would place, from its seed, or undefined when it places none within reach.

Parameters ​
dimension ​

string

biome ​

string

from ​

ScriptVector3

Returns ​

ScriptVector3 | undefined

fogStack() ​

fogStack(player): readonly ScriptFogLayer[] | undefined

Defined in: script-host/src/host/worldsystem/seam.ts:170

A player's fog stack, bottom first, or undefined for a player who is gone.

Parameters ​
player ​

string

Returns ​

readonly ScriptFogLayer[] | undefined

gameRule() ​

gameRule(name): ScriptGameRuleValue

Defined in: script-host/src/host/worldsystem/seam.ts:104

Parameters ​
name ​

"commandBlockOutput" | "commandBlocksEnabled" | "doDayLightCycle" | "doEntityDrops" | "doFireTick" | "doImmediateRespawn" | "doInsomnia" | "doLimitedCrafting" | "doMobLoot" | "doMobSpawning" | "doTileDrops" | "doWeatherCycle" | "drowningDamage" | "fallDamage" | "fireDamage" | "freezeDamage" | "functionCommandLimit" | "keepInventory" | "maxCommandChainLength" | "mobGriefing" | "naturalRegeneration" | "playerWaypoints" | "playersSleepingPercentage" | "projectilesCanBreakBlocks" | "pvp" | "randomTickSpeed" | "recipesUnlock" | "respawnBlocksExplode" | "sendCommandFeedback" | "showBorderEffect" | "showCoordinates" | "showDaysPlayed" | "showDeathMessages" | "showRecipeMessages" | "showTags" | "spawnRadius" | "tntExplodes" | "tntExplosionDropDecay"

Returns ​

ScriptGameRuleValue

generatedStructures() ​

generatedStructures(dimension, location): readonly string[]

Defined in: script-host/src/host/worldsystem/seam.ts:143

The structures generation laid out over a location, by their feature type, such as minecraft:village.

Parameters ​
dimension ​

string

location ​

ScriptVector3

Returns ​

readonly string[]

isHardcore() ​

isHardcore(): boolean

Defined in: script-host/src/host/worldsystem/seam.ts:106

Returns ​

boolean

light() ​

light(dimension, location): ScriptLight | undefined

Defined in: script-host/src/host/worldsystem/seam.ts:120

The light at a block, or undefined when its chunk is not loaded.

Parameters ​
dimension ​

string

location ​

ScriptVector3

Returns ​

ScriptLight | undefined

lootTable() ​

lootTable(path): unknown

Defined in: script-host/src/host/worldsystem/seam.ts:151

A behavior pack loot table's JSON, by its path such as loot_tables/entities/pig.json.

Parameters ​
path ​

string

Returns ​

unknown

placeFeature() ​

placeFeature(dimension, name, location, rule): boolean | "unknown"

Defined in: script-host/src/host/worldsystem/seam.ts:141

Places a feature, or a feature rule's feature, at a location.

Parameters ​
dimension ​

string

name ​

string

location ​

ScriptVector3

rule ​

boolean

Returns ​

boolean | "unknown"

Whether it placed, or unknown for a name the world's packs do not define.

playMusic() ​

playMusic(music): void

Defined in: script-host/src/host/worldsystem/seam.ts:111

Parameters ​
music ​

ScriptMusic

Returns ​

void

removeTickingArea() ​

removeTickingArea(identifier): boolean

Defined in: script-host/src/host/worldsystem/seam.ts:149

Removes a ticking area, and returns whether there was one.

Parameters ​
identifier ​

string

Returns ​

boolean

removeTimeMarker() ​

removeTimeMarker(name): void

Defined in: script-host/src/host/worldsystem/seam.ts:168

Parameters ​
name ​

string

Returns ​

void

rollBlockLoot() ​

rollBlockLoot(permutation, tool?, place?): readonly ScriptItem[] | undefined

Defined in: script-host/src/host/worldsystem/seam.ts:155

What a block drops when broken with a tool, or undefined when the tool cannot harvest it.

Parameters ​
permutation ​

ScriptBlockPermutation

tool? ​

ScriptItem

place? ​

ScriptLootPlace

Returns ​

readonly ScriptItem[] | undefined

rollEntityLoot() ​

rollEntityLoot(typeId, tool?, place?): readonly ScriptItem[] | undefined

Defined in: script-host/src/host/worldsystem/seam.ts:161

What an entity of a type drops when it dies.

Parameters ​
typeId ​

string

tool? ​

ScriptItem

place? ​

ScriptLootPlace

Returns ​

readonly ScriptItem[] | undefined

rollLootTable() ​

rollLootTable(path, tool?): readonly ScriptItem[] | undefined

Defined in: script-host/src/host/worldsystem/seam.ts:153

Rolls a loot table by its path, or undefined for one the packs do not have.

Parameters ​
path ​

string

tool? ​

ScriptItem

Returns ​

readonly ScriptItem[] | undefined

seed() ​

seed(): string

Defined in: script-host/src/host/worldsystem/seam.ts:108

The world's seed, as decimal digits.

Returns ​

string

setAbsoluteTime() ​

setAbsoluteTime(time): void

Defined in: script-host/src/host/worldsystem/seam.ts:98

Parameters ​
time ​

number

Returns ​

void

setAllowCheats() ​

setAllowCheats(allow): void

Defined in: script-host/src/host/worldsystem/seam.ts:110

Parameters ​
allow ​

boolean

Returns ​

void

setClockPaused() ​

setClockPaused(paused): void

Defined in: script-host/src/host/worldsystem/seam.ts:164

Parameters ​
paused ​

boolean

Returns ​

void

setDefaultSpawn() ​

setDefaultSpawn(location): void

Defined in: script-host/src/host/worldsystem/seam.ts:103

Parameters ​
location ​

ScriptVector3

Returns ​

void

setDifficulty() ​

setDifficulty(difficulty): void

Defined in: script-host/src/host/worldsystem/seam.ts:100

Parameters ​
difficulty ​

ScriptDifficulty

Returns ​

void

setFogStack() ​

setFogStack(player, layers): void

Defined in: script-host/src/host/worldsystem/seam.ts:172

Replaces a player's fog stack, which the player's client then draws.

Parameters ​
player ​

string

layers ​

readonly ScriptFogLayer[]

Returns ​

void

setGameRule() ​

setGameRule(name, value): void

Defined in: script-host/src/host/worldsystem/seam.ts:105

Parameters ​
name ​

"commandBlockOutput" | "commandBlocksEnabled" | "doDayLightCycle" | "doEntityDrops" | "doFireTick" | "doImmediateRespawn" | "doInsomnia" | "doLimitedCrafting" | "doMobLoot" | "doMobSpawning" | "doTileDrops" | "doWeatherCycle" | "drowningDamage" | "fallDamage" | "fireDamage" | "freezeDamage" | "functionCommandLimit" | "keepInventory" | "maxCommandChainLength" | "mobGriefing" | "naturalRegeneration" | "playerWaypoints" | "playersSleepingPercentage" | "projectilesCanBreakBlocks" | "pvp" | "randomTickSpeed" | "recipesUnlock" | "respawnBlocksExplode" | "sendCommandFeedback" | "showBorderEffect" | "showCoordinates" | "showDaysPlayed" | "showDeathMessages" | "showRecipeMessages" | "showTags" | "spawnRadius" | "tntExplodes" | "tntExplosionDropDecay"

value ​

ScriptGameRuleValue

Returns ​

void

spawnItem() ​

spawnItem(dimension, item, location): string | undefined

Defined in: script-host/src/host/worldsystem/seam.ts:133

Drops a stack as an item entity that lies still, and returns its id, or undefined when none was made.

Parameters ​
dimension ​

string

item ​

ScriptItem

location ​

ScriptVector3

Returns ​

string | undefined

spawnXp() ​

spawnXp(dimension, location, amount): void

Defined in: script-host/src/host/worldsystem/seam.ts:135

Drops experience orbs worth amount points.

Parameters ​
dimension ​

string

location ​

ScriptVector3

amount ​

number

Returns ​

void

stopMusic() ​

stopMusic(): void

Defined in: script-host/src/host/worldsystem/seam.ts:112

Returns ​

void

stopSound() ​

stopSound(dimension, sound?): void

Defined in: script-host/src/host/worldsystem/seam.ts:116

Stops a sound for every player in a dimension, or every sound when sound is undefined.

Parameters ​
dimension ​

string

sound? ​

string

Returns ​

void

tickingAreas() ​

tickingAreas(): readonly ScriptTickingArea[]

Defined in: script-host/src/host/worldsystem/seam.ts:145

The scripts' ticking areas, in the order they were added; the command's are not among them.

Returns ​

readonly ScriptTickingArea[]

timeMarkers() ​

timeMarkers(): readonly ScriptTimeMarker[]

Defined in: script-host/src/host/worldsystem/seam.ts:166

The time markers scripts added to the overworld's clock, in the order they were added.

Returns ​

readonly ScriptTimeMarker[]

Type Aliases ​

ScriptBlockKind ​

ScriptBlockKind = "air" | "liquid" | "passable" | "solid"

Defined in: script-host/src/host/worldsystem/seam.ts:31

What a block is to a search or a ray: nothing, a liquid, a block an entity walks through, such as short grass, or a block an entity stands on. Water and lava count as passable as well.


ScriptDifficulty ​

ScriptDifficulty = "Easy" | "Hard" | "Normal" | "Peaceful"

Defined in: script-host/src/host/worldsystem/seam.ts:14

A world's difficulty, as Difficulty names it.