API reference / @jsprismarine/prismarine / scripting/LevelScripts
scripting/LevelScripts
Classes
Interfaces
LevelScriptsOptions
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:33
What a level's scripts need from the server.
Properties
addonConfig?
readonlyoptionaladdonConfig?:AddonConfigStore
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:47
The packs' config files, which @jsprismarine/server's config reaches. The module leaves it out when absent.
admin?
readonlyoptionaladmin?:ScriptAdminServer
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:45
The server @minecraft/server-admin's dedicatedServer and its functions reach. They do nothing when absent.
configDirectory
readonlyconfigDirectory:string|undefined
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:37
BDS's config/ folder, which permissions.json and the rest are read from, when there is one.
debugger?
readonlyoptionaldebugger?:object
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:65
The script debugger's settings, and whether the server replays a recorded session, when the debugger never opens a socket. Every connection is refused when absent.
replay
readonlyreplay:boolean
settings
readonlysettings:ScriptDebuggerConfig
sleep?
readonlyoptionalsleep?: (seconds) =>Promise<void>
Resolves after a number of seconds, for auto-attach; a timer when absent.
Parameters
seconds
number
Returns
Promise<void>
experiments?
readonlyoptionalexperiments?: readonlystring[]
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:57
The experiments the level has on, by their level.dat names. Beta APIs lets a pack declare a beta Script API version. None when absent.
log
readonlylog:ScriptLog
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:58
maxPlayers
readonlymaxPlayers:number
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:49
How many players may be online at once, which jsprismarine.maxPlayers tells the packs.
members?
readonlyoptionalmembers?:JsprismarineServerMembers
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:43
What @jsprismarine/server's performance, getPing, bossBars and playerList reach of the server. The module leaves them out when absent.
onShutdown
readonlyonShutdown: () =>void
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:60
Asked to stop the server after a critical exception the watchdog does not let pass.
Returns
void
packDirectories
readonlypackDirectories: readonlystring[]
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:35
The behavior pack directories the level loads; the ones with a script module run.
seed
readonlyseed:bigint
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:51
The level's seed, which Math.random is seeded from.
sources
readonlysources:ScriptWorldSources
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:38
watchdog
readonlywatchdog:ScriptWatchdogConfig
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:52
ScriptPhaseWorld
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:90
A world whose tick runs the level's script flush.
Methods
setScriptPhase()
setScriptPhase(
phase,replacing?):void
Defined in: packages/prismarine/src/scripting/LevelScripts.ts:92
Sets the flush phase; with replacing, only while that phase is the world's current one.
Parameters
phase
(() => void) | undefined
replacing?
() => void
Returns
void