API reference / @jsprismarine/script-host / host/jsprismarineServer
host/jsprismarineServer
Interfaces
FunctionDefinition
Defined in: script-host/src/host/jsprismarineServer.ts:40
A function or a method: its TypeScript parameters and return type.
Properties
parameters
readonlyparameters:string
Defined in: script-host/src/host/jsprismarineServer.ts:43
The parameter list as TypeScript writes it, without the parentheses.
returns
readonlyreturns:string
Defined in: script-host/src/host/jsprismarineServer.ts:44
summary
readonlysummary:string
Defined in: script-host/src/host/jsprismarineServer.ts:41
InterfaceProperty
Defined in: script-host/src/host/jsprismarineServer.ts:48
A property of an interface the module declares, typed in TypeScript.
Properties
optional?
readonlyoptionaloptional?:true
Defined in: script-host/src/host/jsprismarineServer.ts:51
summary
readonlysummary:string
Defined in: script-host/src/host/jsprismarineServer.ts:50
type
readonlytype:string
Defined in: script-host/src/host/jsprismarineServer.ts:49
LiveProperty
Defined in: script-host/src/host/jsprismarineServer.ts:33
A property the server answers each time a script reads it.
Properties
summary
readonlysummary:string
Defined in: script-host/src/host/jsprismarineServer.ts:36
type
readonlytype:"number"|"numbers"
Defined in: script-host/src/host/jsprismarineServer.ts:35
A number, or a frozen list of them.
ValueProperty
Defined in: script-host/src/host/jsprismarineServer.ts:24
A property of an object of plain values that stay the same while the server runs.
Properties
summary
readonlysummary:string
Defined in: script-host/src/host/jsprismarineServer.ts:27
Its documentation, which the typings carry.
type
readonlytype:"string"|"number"
Defined in: script-host/src/host/jsprismarineServer.ts:25
value?
readonlyoptionalvalue?:string
Defined in: script-host/src/host/jsprismarineServer.ts:29
Its value when it is the same on every server; the embedder supplies the others.
Type Aliases
JsprismarineBossBarColor
JsprismarineBossBarColor = typeof
JSPRISMARINE_TYPES["BossBarColor"]["values"][number]
Defined in: script-host/src/host/jsprismarineServer.ts:705
A boss bar color as a script names it.
JsprismarineServerInfo
JsprismarineServerInfo =
{ readonly [Key in keyof ServerProperties as ServerProperties[Key] extends { value: string } ? never : Key]: ServerProperties[Key]["type"] extends "number" ? number : string }
Defined in: script-host/src/host/jsprismarineServer.ts:714
What the embedder tells @jsprismarine/server about the server: every property of jsprismarine without a fixed value, typed as the module declares it.
MemberDefinition
MemberDefinition = {
kind:"values";properties:Readonly<Record<string,ValueProperty>>;summary:string; } | {kind:"live";properties:Readonly<Record<string,LiveProperty>>;summary:string; } |object&FunctionDefinition| {kind:"methods";methods:Readonly<Record<string,FunctionDefinition>>;properties?:Readonly<Record<string,InterfaceProperty>>;summary:string; }
Defined in: script-host/src/host/jsprismarineServer.ts:55
One export of a module.
Union Members
Type Literal
{ kind: "values"; properties: Readonly<Record<string, ValueProperty>>; summary: string; }
A frozen object of plain values that stay the same for the server's whole run.
Type Literal
{ kind: "live"; properties: Readonly<Record<string, LiveProperty>>; summary: string; }
A frozen object whose properties read the server each time.
object & FunctionDefinition
Type Literal
{ kind: "methods"; methods: Readonly<Record<string, FunctionDefinition>>; properties?: Readonly<Record<string, InterfaceProperty>>; summary: string; }
A frozen object of functions, and of properties the script reads from the server.
ServerProperties
ServerProperties = typeof
JSPRISMARINE_SERVER["jsprismarine"]["properties"]
Defined in: script-host/src/host/jsprismarineServer.ts:708
The properties the jsprismarine member of @jsprismarine/server declares.
TypeDefinition
TypeDefinition = {
kind:"union";summary:string;values: readonlystring[]; } | {kind:"alias";summary:string;type:string; } | {kind:"interface";methods?:Readonly<Record<string,FunctionDefinition>>;properties:Readonly<Record<string,InterfaceProperty>>;summary:string; }
Defined in: script-host/src/host/jsprismarineServer.ts:74
A type a module's members take or give.
Union Members
Type Literal
{ kind: "union"; summary: string; values: readonly string[]; }
Type Literal
{ kind: "alias"; summary: string; type: string; }
A type alias written in TypeScript, for a shape an interface cannot say, such as a union of objects.
Type Literal
{ kind: "interface"; methods?: Readonly<Record<string, FunctionDefinition>>; properties: Readonly<Record<string, InterfaceProperty>>; summary: string; }
Variables
JSPRISMARINE_CONFIG_FUNCTIONS
constJSPRISMARINE_CONFIG_FUNCTIONS: readonly ["readConfig","writeConfig","onConfigChange","offConfigChange","setConfigEventMaker"]
Defined in: script-host/src/host/jsprismarineServer.ts:784
The host functions a server gives only when it keeps config files for the packs, and the member that needs them: without the first, the module leaves the member out.
JSPRISMARINE_HOST_FUNCTIONS
constJSPRISMARINE_HOST_FUNCTIONS: readonly ["read","ping","showBar","updateBar","hideBar","barValid","setListName","resetListName","serverListStatus","updateServerList","resetServerList","readConfig","writeConfig","onConfigChange","offConfigChange","setConfigEventMaker","hasPermission","groupsOf","primaryGroupOf","metaOf","grant","revoke","grantToGroup","revokeFromGroup","addToGroup","removeFromGroup","onPermissionsChange","levels","currentLevel","levelOf","transferPlayer","createLevel","attachLevel","detachLevel"]
Defined in: script-host/src/host/jsprismarineServer.ts:728
The functions the namespace's live members call, which the embedder makes in the pack's context.
JSPRISMARINE_MODULE
constJSPRISMARINE_MODULE:"@jsprismarine/server"='@jsprismarine/server'
Defined in: script-host/src/host/jsprismarineServer.ts:14
The name a pack imports the module by.
JSPRISMARINE_PLACEHOLDERS
constJSPRISMARINE_PLACEHOLDERS:object
Defined in: script-host/src/host/jsprismarineServer.ts:583
The members of @jsprismarine/placeholders, by export name: the registry every pack shares. Tokens such as {player:ping} that any pack can provide and any pack can render; a namespace belongs to the pack that registered it and goes when the pack's scripts stop, as on /reload. A host module's exports are copied when the module links, so namespaces is a function rather than a getter.
Type Declaration
namespaces
readonlynamespaces:object
namespaces.kind
readonlykind:"function"='function'
namespaces.parameters
readonlyparameters:""=''
namespaces.returns
readonlyreturns:"readonly PlaceholderNamespace[]"='readonly PlaceholderNamespace[]'
namespaces.summary
readonlysummary:"Every registered namespace with its keys, oldest first, as a new frozen list each call."='Every registered namespace with its keys, oldest first, as a new frozen list each call.'
parse
readonlyparse:object
parse.kind
readonlykind:"function"='function'
parse.parameters
readonlyparameters:"shorthand: string"='shorthand: string'
parse.returns
readonlyreturns:"Template"='Template'
parse.summary
readonlysummary:"Parses the shorthand `{player:name} &7{player:ping}ms` into a template: each token a `placeholder` node, the rest `text` nodes, and `&` before a format code `§`."='Parses the shorthand `{player:name} &7{player:ping}ms` into a template: each token a `placeholder` node, the rest `text` nodes, and `&` before a format code `§`.'
register
readonlyregister:object
register.kind
readonlykind:"function"='function'
register.parameters
readonlyparameters:"namespace: string, provider: PlaceholderProvider"='namespace: string, provider: PlaceholderProvider'
register.returns
readonlyreturns:"PlaceholderRegistration"='PlaceholderRegistration'
register.summary
readonlysummary:"Registers a namespace. Throws a `TypeError` for a namespace or key that is not lowercase letters, digits and underscores starting with a letter, or for a provider with no keys, and an `Error` for a namespace that is registered already."='Registers a namespace. Throws a `TypeError` for a namespace or key that is not lowercase letters, digits and underscores starting with a letter, or for a provider with no keys, and an `Error` for a namespace that is registered already.'
render
readonlyrender:object
render.kind
readonlykind:"function"='function'
render.parameters
readonlyparameters: "template: Template | string, player?: Player" = 'template: Template | string, player?: Player'
render.returns
readonlyreturns:"RenderedTemplate"='RenderedTemplate'
render.summary
readonlysummary:"Renders a template, or a shorthand string, for the player when one is given: the text, and the tick an animation in it next changes the text. Throws a `TypeError` for a node the renderer does not know or a condition that does not parse."='Renders a template, or a shorthand string, for the player when one is given: the text, and the tick an animation in it next changes the text. Throws a `TypeError` for a node the renderer does not know or a condition that does not parse.'
resolve
readonlyresolve:object
resolve.kind
readonlykind:"function"='function'
resolve.parameters
readonlyparameters:"text: string, player?: Player"='text: string, player?: Player'
resolve.returns
readonlyreturns:"string"='string'
resolve.summary
readonlysummary:"Replaces each `{namespace:key}` in the text with its value, for the player when one is given. A token nobody provides, or whose provider gives `undefined` or throws, stays as written, and so does any other text between braces. The watchdog's errors are the exception: a resolver that runs out of the budget ends the render."="Replaces each `{namespace:key}` in the text with its value, for the player when one is given. A token nobody provides, or whose provider gives `undefined` or throws, stays as written, and so does any other text between braces. The watchdog's errors are the exception: a resolver that runs out of the budget ends the render."
JSPRISMARINE_PLACEHOLDERS_HOST_FUNCTIONS
constJSPRISMARINE_PLACEHOLDERS_HOST_FUNCTIONS: readonly ["register","unregister","resolve","namespaces","parseTemplate","renderTemplate"]
Defined in: script-host/src/host/jsprismarineServer.ts:771
The functions @jsprismarine/placeholders calls, which the embedder makes in the pack's context: host.namespaces() answers the registered namespaces as JSON, host.parseTemplate and host.renderTemplate take and give templates as JSON, and the others are named for what they do.
JSPRISMARINE_PLACEHOLDERS_MODULE
constJSPRISMARINE_PLACEHOLDERS_MODULE:"@jsprismarine/placeholders"='@jsprismarine/placeholders'
Defined in: script-host/src/host/jsprismarineServer.ts:21
The name a pack imports the placeholders by. @jsprismarine/server holds the members that read or change the running server and its players; a feature with a type vocabulary of its own, one that would stand as a library by itself, gets a module of its own, and placeholders are the first.
JSPRISMARINE_PLACEHOLDER_TYPES
constJSPRISMARINE_PLACEHOLDER_TYPES:object
Defined in: script-host/src/host/jsprismarineServer.ts:625
The types @jsprismarine/placeholders takes and gives. Player is @jsprismarine/server's compatibility type, what the members read of a player they are given; MinecraftPlayer is @minecraft/server's, what a provider gets, since the runtime hands it the pack's own object.
Type Declaration
PlaceholderNamespace
readonlyPlaceholderNamespace:object
PlaceholderNamespace.kind
readonlykind:"interface"='interface'
PlaceholderNamespace.properties
readonlyproperties:object
PlaceholderNamespace.properties.keys
readonlykeys:object
PlaceholderNamespace.properties.keys.summary
readonlysummary:"The keys its provider answers."='The keys its provider answers.'
PlaceholderNamespace.properties.keys.type
readonlytype:"readonly string[]"='readonly string[]'
PlaceholderNamespace.properties.namespace
readonlynamespace:object
PlaceholderNamespace.properties.namespace.summary
readonlysummary:"Its name, the part of a token before the colon."='Its name, the part of a token before the colon.'
PlaceholderNamespace.properties.namespace.type
readonlytype:"string"='string'
PlaceholderNamespace.summary
readonlysummary:"One registered namespace."='One registered namespace.'
PlaceholderProvider
readonlyPlaceholderProvider:object
PlaceholderProvider.kind
readonlykind:"interface"='interface'
PlaceholderProvider.methods
readonlymethods:object
PlaceholderProvider.methods.resolve
readonlyresolve:object
PlaceholderProvider.methods.resolve.parameters
readonlyparameters:"key: string, player?: MinecraftPlayer"='key: string, player?: MinecraftPlayer'
PlaceholderProvider.methods.resolve.returns
readonlyreturns: "string | number | undefined" = 'string | number | undefined'
PlaceholderProvider.methods.resolve.summary
readonlysummary:"The value of one key, for the player when the text is rendered for one: the pack's own `Player` of `@minecraft/server`, with every member it has. A number renders through `String()`. `undefined` leaves the token as written, and so does a throw, which the content log reports once per namespace. It runs inside the budget of the script that renders, and the watchdog's errors end the render rather than leaving the token."="The value of one key, for the player when the text is rendered for one: the pack's own `Player` of `@minecraft/server`, with every member it has. A number renders through `String()`. `undefined` leaves the token as written, and so does a throw, which the content log reports once per namespace. It runs inside the budget of the script that renders, and the watchdog's errors end the render rather than leaving the token."
PlaceholderProvider.properties
readonlyproperties:object
PlaceholderProvider.properties.keys
readonlykeys:object
PlaceholderProvider.properties.keys.summary
readonlysummary:"The keys the provider answers, each lowercase letters, digits and underscores starting with a letter. A token with another key stays as written."='The keys the provider answers, each lowercase letters, digits and underscores starting with a letter. A token with another key stays as written.'
PlaceholderProvider.properties.keys.type
readonlytype:"readonly string[]"='readonly string[]'
PlaceholderProvider.summary
readonlysummary:"What a pack registers for a namespace: the keys it answers, and the function that answers them."='What a pack registers for a namespace: the keys it answers, and the function that answers them.'
PlaceholderRegistration
readonlyPlaceholderRegistration:object
PlaceholderRegistration.kind
readonlykind:"interface"='interface'
PlaceholderRegistration.methods
readonlymethods:object
PlaceholderRegistration.methods.unregister
readonlyunregister:object
PlaceholderRegistration.methods.unregister.parameters
readonlyparameters:""=''
PlaceholderRegistration.methods.unregister.returns
readonlyreturns:"void"='void'
PlaceholderRegistration.methods.unregister.summary
readonlysummary:"Takes the namespace out of the registry, so its tokens stay as written. A pack's namespaces go on their own when its scripts stop."="Takes the namespace out of the registry, so its tokens stay as written. A pack's namespaces go on their own when its scripts stop."
PlaceholderRegistration.properties
readonlyproperties:object={}
PlaceholderRegistration.summary
readonlysummary:"A namespace a pack registered."='A namespace a pack registered.'
RenderedTemplate
readonlyRenderedTemplate:object
RenderedTemplate.kind
readonlykind:"interface"='interface'
RenderedTemplate.properties
readonlyproperties:object
RenderedTemplate.properties.nextChangeTick
readonlynextChangeTick:object
RenderedTemplate.properties.nextChangeTick.optional
readonlyoptional:true=true
RenderedTemplate.properties.nextChangeTick.summary
readonlysummary:"The tick at which an animation in the template next changes the text, so a consumer that refreshes on an interval renders again then. Absent when the template holds no animation with more than one frame."='The tick at which an animation in the template next changes the text, so a consumer that refreshes on an interval renders again then. Absent when the template holds no animation with more than one frame.'
RenderedTemplate.properties.nextChangeTick.type
readonlytype:"number"='number'
RenderedTemplate.properties.text
readonlytext:object
RenderedTemplate.properties.text.summary
readonlysummary:"The rendered text."='The rendered text.'
RenderedTemplate.properties.text.type
readonlytype:"string"='string'
RenderedTemplate.summary
readonlysummary:"What `placeholders.render` gave."='What `placeholders.render` gave.'
Template
readonlyTemplate:object
Template.kind
readonlykind:"interface"='interface'
Template.properties
readonlyproperties:object
Template.properties.rawtext
readonlyrawtext:object
Template.properties.rawtext.summary
readonlysummary:"The nodes, rendered in order."='The nodes, rendered in order.'
Template.properties.rawtext.type
readonlytype:"readonly TemplateNode[]"='readonly TemplateNode[]'
Template.summary
readonlysummary:"A template: a tree in the shape of Bedrock's rawtext, the format `/tellraw` takes, with a few more node kinds. `placeholders.parse` makes one from shorthand, and a file or a script can hold one."="A template: a tree in the shape of Bedrock's rawtext, the format `/tellraw` takes, with a few more node kinds. `placeholders.parse` makes one from shorthand, and a file or a script can hold one."
TemplateNode
readonlyTemplateNode:object
TemplateNode.kind
readonlykind:"alias"='alias'
TemplateNode.summary
readonlysummary: "One node of a template: a `text`; a `placeholder` named `namespace:key`; an `if` with a condition over placeholders and literals (`==`, `!=`, `<`, `<=`, `>`, `>=`, `contains`, `startsWith`, joined by `&&` and `||`, with parentheses; two sides that both parse as numbers compare as numbers) and its `then` and `else` nodes; an `animate` with `frames` and an `interval` in ticks; a `gradient` with `#rrggbb` colors over its `rawtext`, each character in the nearest `§` color; and rawtext's `translate`, which renders as its key, `score`, which reads the scoreboard, and `selector`, which reads as the names of the entities the server's selector grammar matches, so `@a[tag=vip]` works. A bare string is a `text` node." = "One node of a template: a `text`; a `placeholder` named `namespace:key`; an `if` with a condition over placeholders and literals (`==`, `!=`, `<`, `<=`, `>`, `>=`, `contains`, `startsWith`, joined by `&&` and `||`, with parentheses; two sides that both parse as numbers compare as numbers) and its `then` and `else` nodes; an `animate` with `frames` and an `interval` in ticks; a `gradient` with `#rrggbb` colors over its `rawtext`, each character in the nearest `§` color; and rawtext's `translate`, which renders as its key, `score`, which reads the scoreboard, and `selector`, which reads as the names of the entities the server's selector grammar matches, so `@a[tag=vip]` works. A bare string is a `text` node."
TemplateNode.type
readonlytype:string
JSPRISMARINE_SERVER
constJSPRISMARINE_SERVER:object
Defined in: script-host/src/host/jsprismarineServer.ts:90
The members of @jsprismarine/server, by export name. jsprismarine holds plain values that stay the same for the server's whole run. The others reach the running server, and a server that cannot give them leaves them out, so a pack checks for one with in before it uses it.
Type Declaration
bossBars
readonlybossBars:object
bossBars.kind
readonlykind:"methods"='methods'
bossBars.methods
readonlymethods:object
bossBars.methods.show
readonlyshow:object
bossBars.methods.show.parameters
readonlyparameters:"player: Player, options?: BossBarOptions"='player: Player, options?: BossBarOptions'
bossBars.methods.show.returns
readonlyreturns:"BossBar"='BossBar'
bossBars.methods.show.summary
readonlysummary:"Shows a boss bar to one player, alongside every bar already on their screen. A bar for a player who left is never valid."='Shows a boss bar to one player, alongside every bar already on their screen. A bar for a player who left is never valid.'
bossBars.summary
readonlysummary:"Boss bars on one player's screen. A bar belongs to the pack that showed it and goes away when the player leaves or the pack's scripts stop, as on `/reload`."="Boss bars on one player's screen. A bar belongs to the pack that showed it and goes away when the player leaves or the pack's scripts stop, as on `/reload`."
config
readonlyconfig:object
config.kind
readonlykind:"methods"='methods'
config.methods
readonlymethods:object
config.methods.write
readonlywrite:object
config.methods.write.parameters
readonlyparameters:"value: unknown"='value: unknown'
config.methods.write.returns
readonlyreturns:"void"='void'
config.methods.write.summary
readonlysummary:"Rewrites the file with the value as JSON, so the pack's commands and the owner's editor change the same thing. `change` fires for it as for an edit. Throws a `TypeError` for a value JSON cannot carry."="Rewrites the file with the value as JSON, so the pack's commands and the owner's editor change the same thing. `change` fires for it as for an edit. Throws a `TypeError` for a value JSON cannot carry."
config.properties
readonlyproperties:object
config.properties.afterEvents
readonlyafterEvents:object
config.properties.afterEvents.summary
readonlysummary:"What the file does."='What the file does.'
config.properties.afterEvents.type
readonlytype:"AddonConfigEvents"='AddonConfigEvents'
config.properties.value
readonlyvalue:object
config.properties.value.summary
readonlysummary:"The parsed JSON of the file, as a new frozen value each read, or `undefined` while there is no file. A file that fails to parse keeps the last value, and the content log says so once."='The parsed JSON of the file, as a new frozen value each read, or `undefined` while there is no file. A file that fails to parse keeps the last value, and the content log says so once.'
config.properties.value.type
readonlytype:"unknown"='unknown'
config.summary
readonlysummary:"The pack's config file: `<folder>.config.json` beside the pack's folder, which for an addon installed as `addons/<name>/` is `addons/<name>.config.json`. The owner edits it and the pack reads it. The server parses it; the pack checks the shape itself."="The pack's config file: `<folder>.config.json` beside the pack's folder, which for an addon installed as `addons/<name>/` is `addons/<name>.config.json`. The owner edits it and the pack reads it. The server parses it; the pack checks the shape itself."
getPing
readonlygetPing:object
getPing.kind
readonlykind:"function"='function'
getPing.parameters
readonlyparameters:"player: Player"='player: Player'
getPing.returns
readonlyreturns: "number | undefined" = 'number | undefined'
getPing.summary
readonlysummary:"The player's round trip time in milliseconds, or `undefined` while their connection has no sample, after they leave, or when their transport measures none."="The player's round trip time in milliseconds, or `undefined` while their connection has no sample, after they leave, or when their transport measures none."
jsprismarine
readonlyjsprismarine:object
jsprismarine.kind
readonlykind:"values"='values'
jsprismarine.properties
readonlyproperties:object
jsprismarine.properties.maxPlayers
readonlymaxPlayers:object
jsprismarine.properties.maxPlayers.summary
readonlysummary:"How many players may be online at once, the server's `max-players` setting."="How many players may be online at once, the server's `max-players` setting."
jsprismarine.properties.maxPlayers.type
readonlytype:"number"='number'
jsprismarine.properties.minecraftVersion
readonlyminecraftVersion:object
jsprismarine.properties.minecraftVersion.summary
readonlysummary:"The newest Minecraft Bedrock release the server speaks, the one it advertises."='The newest Minecraft Bedrock release the server speaks, the one it advertises.'
jsprismarine.properties.minecraftVersion.type
readonlytype:"string"='string'
jsprismarine.properties.name
readonlyname:object
jsprismarine.properties.name.summary
readonlysummary:"The server software, always `JSPrismarine`."='The server software, always `JSPrismarine`.'
jsprismarine.properties.name.type
readonlytype:"string"='string'
jsprismarine.properties.name.value
readonlyvalue:"JSPrismarine"='JSPrismarine'
jsprismarine.properties.protocolVersion
readonlyprotocolVersion:object
jsprismarine.properties.protocolVersion.summary
readonlysummary:"The Bedrock network protocol version of `minecraftVersion`."='The Bedrock network protocol version of `minecraftVersion`.'
jsprismarine.properties.protocolVersion.type
readonlytype:"number"='number'
jsprismarine.properties.version
readonlyversion:object
jsprismarine.properties.version.summary
readonlysummary:"The JSPrismarine version, such as `0.22.0`, without a leading `v`."='The JSPrismarine version, such as `0.22.0`, without a leading `v`.'
jsprismarine.properties.version.type
readonlytype:"string"='string'
jsprismarine.summary
readonlysummary:"The server the pack runs on."='The server the pack runs on.'
levels
readonlylevels:object
levels.kind
readonlykind:"methods"='methods'
levels.methods
readonlymethods:object
levels.methods.attach
readonlyattach:object
levels.methods.attach.parameters
readonlyparameters:"level: string"='level: string'
levels.methods.attach.returns
readonlyreturns:"Promise<LevelInfo>"='Promise<LevelInfo>'
levels.methods.attach.summary
readonlysummary:"Attaches a detached level `levels.json` records, so players can go there again."='Attaches a detached level `levels.json` records, so players can go there again.'
levels.methods.create
readonlycreate:object
levels.methods.create.parameters
readonlyparameters:"name: string, options?: LevelCreateOptions"='name: string, options?: LevelCreateOptions'
levels.methods.create.returns
readonlyreturns:"Promise<LevelInfo>"='Promise<LevelInfo>'
levels.methods.create.summary
readonlysummary:"Creates a level, records it in `levels.json` and attaches it. Rejects for a name that is taken or not 1 to 64 letters, digits, `_` or `-`."='Creates a level, records it in `levels.json` and attaches it. Rejects for a name that is taken or not 1 to 64 letters, digits, `_` or `-`.'
levels.methods.detach
readonlydetach:object
levels.methods.detach.parameters
readonlyparameters:"level: string"='level: string'
levels.methods.detach.returns
readonlyreturns:"Promise<void>"='Promise<void>'
levels.methods.detach.summary
readonlysummary:"Saves a level, moves its players to the entry level and detaches it. Its files stay. Rejects for the entry level and a level `config.json` names. Detaching the pack's own level stops its scripts there, so the promise never settles."="Saves a level, moves its players to the entry level and detaches it. Its files stay. Rejects for the entry level and a level `config.json` names. Detaching the pack's own level stops its scripts there, so the promise never settles."
levels.methods.levelOf
readonlylevelOf:object
levels.methods.levelOf.parameters
readonlyparameters:"player: Player"='player: Player'
levels.methods.levelOf.returns
readonlyreturns:"LevelInfo"='LevelInfo'
levels.methods.levelOf.summary
readonlysummary:"The level the player is in. Throws a `TypeError` for a player who left."='The level the player is in. Throws a `TypeError` for a player who left.'
levels.methods.list
readonlylist:object
levels.methods.list.parameters
readonlyparameters:""=''
levels.methods.list.returns
readonlyreturns:"readonly LevelInfo[]"='readonly LevelInfo[]'
levels.methods.list.summary
readonlysummary:"Every level the server knows: the attached ones first, then the detached ones `levels.json` keeps."='Every level the server knows: the attached ones first, then the detached ones `levels.json` keeps.'
levels.methods.transfer
readonlytransfer:object
levels.methods.transfer.parameters
readonlyparameters:"player: Player, level: string, options?: LevelTransferOptions"='player: Player, level: string, options?: LevelTransferOptions'
levels.methods.transfer.returns
readonlyreturns:"Promise<boolean>"='Promise<boolean>'
levels.methods.transfer.summary
readonlysummary:"Moves the player to an attached level: to where they last were there, or to its spawn when they have never been in it or `toSpawn` is set. They leave their record behind and pick up the level's, except the parts a `player-data-groups` group shares. Resolves to whether the move landed. Rejects for a level that is not attached."="Moves the player to an attached level: to where they last were there, or to its spawn when they have never been in it or `toSpawn` is set. They leave their record behind and pick up the level's, except the parts a `player-data-groups` group shares. Resolves to whether the move landed. Rejects for a level that is not attached."
levels.properties
readonlyproperties:object
levels.properties.current
readonlycurrent:object
levels.properties.current.summary
readonlysummary:"The level the pack's scripts run in."="The level the pack's scripts run in."
levels.properties.current.type
readonlytype:"LevelInfo"='LevelInfo'
levels.summary
readonlysummary:"The server's levels, each a world of its own with its dimensions, players' records and scripts. A level is named by its name, unique among the attached ones, or by its UUID. The pack's scripts run in one level; a pack that every level loads runs once in each."="The server's levels, each a world of its own with its dimensions, players' records and scripts. A level is named by its name, unique among the attached ones, or by its UUID. The pack's scripts run in one level; a pack that every level loads runs once in each."
performance
readonlyperformance:object
performance.kind
readonlykind:"live"='live'
performance.properties
readonlyproperties:object
performance.properties.averageTickMs
readonlyaverageTickMs:object
performance.properties.averageTickMs.summary
readonlysummary:"How long a tick's work has taken lately, in milliseconds, as a moving average over the recent ticks. Zero before the first tick."="How long a tick's work has taken lately, in milliseconds, as a moving average over the recent ticks. Zero before the first tick."
performance.properties.averageTickMs.type
readonlytype:"number"='number'
performance.properties.heapAllocatedBytes
readonlyheapAllocatedBytes:object
performance.properties.heapAllocatedBytes.summary
readonlysummary:"The bytes the runtime has reserved for the heap, which `heapUsedBytes` fills."='The bytes the runtime has reserved for the heap, which `heapUsedBytes` fills.'
performance.properties.heapAllocatedBytes.type
readonlytype:"number"='number'
performance.properties.heapLimitBytes
readonlyheapLimitBytes:object
performance.properties.heapLimitBytes.summary
readonlysummary:"The most bytes the heap may grow to before the runtime runs out of memory, which `--max-old-space-size` sets on Node.js."='The most bytes the heap may grow to before the runtime runs out of memory, which `--max-old-space-size` sets on Node.js.'
performance.properties.heapLimitBytes.type
readonlytype:"number"='number'
performance.properties.heapUsedBytes
readonlyheapUsedBytes:object
performance.properties.heapUsedBytes.summary
readonlysummary:"The bytes the server's JavaScript heap holds now, garbage not yet collected included. Buffers and native memory outside the heap are not counted."="The bytes the server's JavaScript heap holds now, garbage not yet collected included. Buffers and native memory outside the heap are not counted."
performance.properties.heapUsedBytes.type
readonlytype:"number"='number'
performance.properties.lastTickMs
readonlylastTickMs:object
performance.properties.lastTickMs.summary
readonlysummary:"How long the last tick's work took, in milliseconds, without the wait before the next tick. Zero before the first tick."="How long the last tick's work took, in milliseconds, without the wait before the next tick. Zero before the first tick."
performance.properties.lastTickMs.type
readonlytype:"number"='number'
performance.properties.tps
readonlytps:object
performance.properties.tps.summary
readonlysummary:"Ticks per second over the last second. The server aims for 20, and runs above it while it catches up."='Ticks per second over the last second. The server aims for 20, and runs above it while it catches up.'
performance.properties.tps.type
readonlytype:"number"='number'
performance.properties.tpsAverages
readonlytpsAverages:object
performance.properties.tpsAverages.summary
readonlysummary:"Ticks per second averaged over the windows `/tps` reports, shortest first."='Ticks per second averaged over the windows `/tps` reports, shortest first.'
performance.properties.tpsAverages.type
readonlytype:"numbers"='numbers'
performance.summary
readonlysummary:"How fast the server ticks and how much memory its JavaScript heap holds. Each property reads the server when the script reads it."='How fast the server ticks and how much memory its JavaScript heap holds. Each property reads the server when the script reads it.'
permissions
readonlypermissions:object
permissions.kind
readonlykind:"methods"='methods'
permissions.methods
readonlymethods:object
permissions.methods.addToGroup
readonlyaddToGroup:object
permissions.methods.addToGroup.parameters
readonlyparameters:"player: Player, group: string, expires?: string"='player: Player, group: string, expires?: string'
permissions.methods.addToGroup.returns
readonlyreturns:"void"='void'
permissions.methods.addToGroup.summary
readonlysummary:"Adds a player to a group, until `expires` when one is given. Throws an `Error` for a group the file does not have."='Adds a player to a group, until `expires` when one is given. Throws an `Error` for a group the file does not have.'
permissions.methods.grant
readonlygrant:object
permissions.methods.grant.parameters
readonlyparameters:"player: Player, node: string, expires?: string"='player: Player, node: string, expires?: string'
permissions.methods.grant.returns
readonlyreturns:"void"='void'
permissions.methods.grant.summary
readonlysummary:"Adds a node to the player. Throws a `RangeError` for a node not spelled as `scope.name`, `scope.*` or `*` with at most one leading `-`, or for an expiry that is not an ISO 8601 instant with a time zone in the future."='Adds a node to the player. Throws a `RangeError` for a node not spelled as `scope.name`, `scope.*` or `*` with at most one leading `-`, or for an expiry that is not an ISO 8601 instant with a time zone in the future.'
permissions.methods.grantToGroup
readonlygrantToGroup:object
permissions.methods.grantToGroup.parameters
readonlyparameters:"group: string, node: string, expires?: string"='group: string, node: string, expires?: string'
permissions.methods.grantToGroup.returns
readonlyreturns:"void"='void'
permissions.methods.grantToGroup.summary
readonlysummary:"Adds a node to the group named. Throws as `grant` does for the node and the expiry, and an `Error` for a group the file does not have."='Adds a node to the group named. Throws as `grant` does for the node and the expiry, and an `Error` for a group the file does not have.'
permissions.methods.groupsOf
readonlygroupsOf:object
permissions.methods.groupsOf.parameters
readonlyparameters:"player: Player"='player: Player'
permissions.methods.groupsOf.returns
readonlyreturns:"readonly string[]"='readonly string[]'
permissions.methods.groupsOf.summary
readonlysummary:"The groups the player holds directly, heaviest first, `default` and an operator's `operator` included."="The groups the player holds directly, heaviest first, `default` and an operator's `operator` included."
permissions.methods.has
readonlyhas:object
permissions.methods.has.parameters
readonlyparameters:"player: Player, node: string"='player: Player, node: string'
permissions.methods.has.returns
readonlyreturns:"boolean"='boolean'
permissions.methods.has.summary
readonlysummary:"Whether the player holds the node after resolution: their own nodes, then their groups heaviest first and each group's parents, where a specific node beats a wildcard and a negation wins a tie. An operator holds every node."="Whether the player holds the node after resolution: their own nodes, then their groups heaviest first and each group's parents, where a specific node beats a wildcard and a negation wins a tie. An operator holds every node."
permissions.methods.metaOf
readonlymetaOf:object
permissions.methods.metaOf.parameters
readonlyparameters:"player: Player, key: string"='player: Player, key: string'
permissions.methods.metaOf.returns
readonlyreturns: "string | undefined" = 'string | undefined'
permissions.methods.metaOf.summary
readonlysummary:"The resolved value of a meta key such as `prefix`, `suffix` or `level`: the player's own, then their groups' in resolution order. `undefined` when nothing sets it."="The resolved value of a meta key such as `prefix`, `suffix` or `level`: the player's own, then their groups' in resolution order. `undefined` when nothing sets it."
permissions.methods.primaryGroupOf
readonlyprimaryGroupOf:object
permissions.methods.primaryGroupOf.parameters
readonlyparameters:"player: Player"='player: Player'
permissions.methods.primaryGroupOf.returns
readonlyreturns:"string"='string'
permissions.methods.primaryGroupOf.summary
readonlysummary:"The heaviest group the player holds directly, or `default`."='The heaviest group the player holds directly, or `default`.'
permissions.methods.removeFromGroup
readonlyremoveFromGroup:object
permissions.methods.removeFromGroup.parameters
readonlyparameters:"player: Player, group: string"='player: Player, group: string'
permissions.methods.removeFromGroup.returns
readonlyreturns:"void"='void'
permissions.methods.removeFromGroup.summary
readonlysummary:"Removes a player from a group. Does nothing when they are not in it."='Removes a player from a group. Does nothing when they are not in it.'
permissions.methods.revoke
readonlyrevoke:object
permissions.methods.revoke.parameters
readonlyparameters:"player: Player, node: string"='player: Player, node: string'
permissions.methods.revoke.returns
readonlyreturns:"void"='void'
permissions.methods.revoke.summary
readonlysummary:"Removes a node from the player. Does nothing when they do not have it."='Removes a node from the player. Does nothing when they do not have it.'
permissions.methods.revokeFromGroup
readonlyrevokeFromGroup:object
permissions.methods.revokeFromGroup.parameters
readonlyparameters:"group: string, node: string"='group: string, node: string'
permissions.methods.revokeFromGroup.returns
readonlyreturns:"void"='void'
permissions.methods.revokeFromGroup.summary
readonlysummary:"Removes a node from the group named. Does nothing when it does not have it."='Removes a node from the group named. Does nothing when it does not have it.'
permissions.properties
readonlyproperties:object
permissions.properties.afterEvents
readonlyafterEvents:object
permissions.properties.afterEvents.summary
readonlysummary:"The events the permission files raise."='The events the permission files raise.'
permissions.properties.afterEvents.type
readonlytype:"PermissionsAfterEvents"='PermissionsAfterEvents'
permissions.summary
readonlysummary:"The groups, nodes and meta of `permissions.json`, resolved as the server resolves them for a command. A write persists to the file as `/perms` would, and `afterEvents.permissionsChange` fires after any write, from a script, `/perms`, `/op` or an edit of the file."='The groups, nodes and meta of `permissions.json`, resolved as the server resolves them for a command. A write persists to the file as `/perms` would, and `afterEvents.permissionsChange` fires after any write, from a script, `/perms`, `/op` or an edit of the file.'
playerList
readonlyplayerList:object
playerList.kind
readonlykind:"methods"='methods'
playerList.methods
readonlymethods:object
playerList.methods.reset
readonlyreset:object
playerList.methods.reset.parameters
readonlyparameters:"player: Player"='player: Player'
playerList.methods.reset.returns
readonlyreturns:"void"='void'
playerList.methods.reset.summary
readonlysummary:"Gives the player's entry its login name back, at once rather than when the scripts stop."="Gives the player's entry its login name back, at once rather than when the scripts stop."
playerList.methods.setDisplayName
readonlysetDisplayName:object
playerList.methods.setDisplayName.parameters
readonlyparameters:"player: Player, name: string"='player: Player, name: string'
playerList.methods.setDisplayName.returns
readonlyreturns:"void"='void'
playerList.methods.setDisplayName.summary
readonlysummary:"Changes the name every client, and every later joiner, shows for the player in its player list, and nothing else. Throws for an empty name. Does nothing for a player who left."='Changes the name every client, and every later joiner, shows for the player in its player list, and nothing else. Throws for an empty name. Does nothing for a player who left.'
playerList.summary
readonlysummary:"The player list every client shows, in the pause menu. A name a pack sets there reverts when the pack's scripts stop, as on `/reload`. Chat and the name above the head keep the login name."="The player list every client shows, in the pause menu. A name a pack sets there reverts when the pack's scripts stop, as on `/reload`. Chat and the name above the head keep the login name."
serverList
readonlyserverList:object
serverList.kind
readonlykind:"methods"='methods'
serverList.methods
readonlymethods:object
serverList.methods.reset
readonlyreset:object
serverList.methods.reset.parameters
readonlyparameters:""=''
serverList.methods.reset.returns
readonlyreturns:"void"='void'
serverList.methods.reset.summary
readonlysummary:"Takes back every change the pack made, at once rather than when its scripts stop, so the list shows another pack's change or the server's own values again."="Takes back every change the pack made, at once rather than when its scripts stop, so the list shows another pack's change or the server's own values again."
serverList.methods.update
readonlyupdate:object
serverList.methods.update.parameters
readonlyparameters:"options: ServerListOptions"='options: ServerListOptions'
serverList.methods.update.returns
readonlyreturns:"void"='void'
serverList.methods.update.summary
readonlysummary:"Changes what the server list shows. A property the options leave out keeps the value the pack gave it before, or the server's own. Throws a `TypeError` for a MOTD or second name with a `;`, which the Bedrock ping cannot carry, and for a count that is not a whole number from 0 to 2147483647."="Changes what the server list shows. A property the options leave out keeps the value the pack gave it before, or the server's own. Throws a `TypeError` for a MOTD or second name with a `;`, which the Bedrock ping cannot carry, and for a count that is not a whole number from 0 to 2147483647."
serverList.properties
readonlyproperties:object
serverList.properties.levelName
readonlylevelName:object
serverList.properties.levelName.summary
readonlysummary:"The second name, which a Bedrock client shows below the MOTD for a server on its LAN. `JSPrismarine` until a pack changes it."='The second name, which a Bedrock client shows below the MOTD for a server on its LAN. `JSPrismarine` until a pack changes it.'
serverList.properties.levelName.type
readonlytype:"string"='string'
serverList.properties.maxPlayers
readonlymaxPlayers:object
serverList.properties.maxPlayers.summary
readonlysummary:"The player limit the list shows. `max-players` until a pack changes it. A change shows in the list only: the server still turns a player away at `max-players`."='The player limit the list shows. `max-players` until a pack changes it. A change shows in the list only: the server still turns a player away at `max-players`.'
serverList.properties.maxPlayers.type
readonlytype:"number"='number'
serverList.properties.motd
readonlymotd:object
serverList.properties.motd.summary
readonlysummary:"The MOTD, the server's first line, which `§` format codes color. `config.json`'s `motd` until a pack changes it."="The MOTD, the server's first line, which `§` format codes color. `config.json`'s `motd` until a pack changes it."
serverList.properties.motd.type
readonlytype:"string"='string'
serverList.properties.onlinePlayers
readonlyonlinePlayers:object
serverList.properties.onlinePlayers.summary
readonlysummary:"How many players the list says are online. The players connected over every transport until a pack changes it."='How many players the list says are online. The players connected over every transport until a pack changes it.'
serverList.properties.onlinePlayers.type
readonlytype:"number"='number'
serverList.summary
readonlysummary:"What a server list shows of the server, the same over every way a client asks: Bedrock's server list and LAN, the query protocol and Java Edition's multiplayer screen. Each property reads what the list shows now. A change belongs to the pack that made it and goes when the pack's scripts stop, as on `/reload`; where two packs change one property, the one that changed it last shows."="What a server list shows of the server, the same over every way a client asks: Bedrock's server list and LAN, the query protocol and Java Edition's multiplayer screen. Each property reads what the list shows now. A change belongs to the pack that made it and goes when the pack's scripts stop, as on `/reload`; where two packs change one property, the one that changed it last shows."
JSPRISMARINE_TYPES
constJSPRISMARINE_TYPES:object
Defined in: script-host/src/host/jsprismarineServer.ts:370
The types the members take and give, by the name the declarations give them.
Type Declaration
AddonConfigChangeEvent
readonlyAddonConfigChangeEvent:object
AddonConfigChangeEvent.kind
readonlykind:"interface"='interface'
AddonConfigChangeEvent.properties
readonlyproperties:object
AddonConfigChangeEvent.properties.value
readonlyvalue:object
AddonConfigChangeEvent.properties.value.summary
readonlysummary:"The parsed JSON of the file after the change, frozen, or `undefined` when the file is gone. A file that fails to parse gives the last value."='The parsed JSON of the file after the change, frozen, or `undefined` when the file is gone. A file that fails to parse gives the last value.'
AddonConfigChangeEvent.properties.value.type
readonlytype:"unknown"='unknown'
AddonConfigChangeEvent.summary
readonlysummary:"A change of the config file."='A change of the config file.'
AddonConfigChangeSignal
readonlyAddonConfigChangeSignal:object
AddonConfigChangeSignal.kind
readonlykind:"interface"='interface'
AddonConfigChangeSignal.methods
readonlymethods:object
AddonConfigChangeSignal.methods.subscribe
readonlysubscribe:object
AddonConfigChangeSignal.methods.subscribe.parameters
readonlyparameters:"callback: (event: AddonConfigChangeEvent) => void"='callback: (event: AddonConfigChangeEvent) => void'
AddonConfigChangeSignal.methods.subscribe.returns
readonlyreturns:"(event: AddonConfigChangeEvent) => void"='(event: AddonConfigChangeEvent) => void'
AddonConfigChangeSignal.methods.subscribe.summary
readonlysummary:"Calls the callback after each change, with the new value. Gives the callback back, for `unsubscribe`."='Calls the callback after each change, with the new value. Gives the callback back, for `unsubscribe`.'
AddonConfigChangeSignal.methods.unsubscribe
readonlyunsubscribe:object
AddonConfigChangeSignal.methods.unsubscribe.parameters
readonlyparameters:"callback: (event: AddonConfigChangeEvent) => void"='callback: (event: AddonConfigChangeEvent) => void'
AddonConfigChangeSignal.methods.unsubscribe.returns
readonlyreturns:"void"='void'
AddonConfigChangeSignal.methods.unsubscribe.summary
readonlysummary:"Stops calling a callback `subscribe` took."='Stops calling a callback `subscribe` took.'
AddonConfigChangeSignal.properties
readonlyproperties:object={}
AddonConfigChangeSignal.summary
readonlysummary:"Subscribes to changes of the config file, as a `@minecraft/server` signal does."='Subscribes to changes of the config file, as a `@minecraft/server` signal does.'
AddonConfigEvents
readonlyAddonConfigEvents:object
AddonConfigEvents.kind
readonlykind:"interface"='interface'
AddonConfigEvents.properties
readonlyproperties:object
AddonConfigEvents.properties.change
readonlychange:object
AddonConfigEvents.properties.change.summary
readonlysummary:"Fires on the first flush after the server's watch reports the settled change to the file, by an editor or by `config.write`. The watch waits for a burst of writes to settle, so one save gives one event."="Fires on the first flush after the server's watch reports the settled change to the file, by an editor or by `config.write`. The watch waits for a burst of writes to settle, so one save gives one event."
AddonConfigEvents.properties.change.type
readonlytype:"AddonConfigChangeSignal"='AddonConfigChangeSignal'
AddonConfigEvents.summary
readonlysummary:"Events about the pack's config file."="Events about the pack's config file."
BossBar
readonlyBossBar:object
BossBar.kind
readonlykind:"interface"='interface'
BossBar.methods
readonlymethods:object
BossBar.methods.hide
readonlyhide:object
BossBar.methods.hide.parameters
readonlyparameters:""=''
BossBar.methods.hide.returns
readonlyreturns:"void"='void'
BossBar.methods.hide.summary
readonlysummary:"Takes the bar off the screen for good. Does nothing to a bar that is no longer valid."='Takes the bar off the screen for good. Does nothing to a bar that is no longer valid.'
BossBar.methods.update
readonlyupdate:object
BossBar.methods.update.parameters
readonlyparameters:"options: BossBarOptions"='options: BossBarOptions'
BossBar.methods.update.returns
readonlyreturns:"void"='void'
BossBar.methods.update.summary
readonlysummary:"Changes what the bar shows. A property the options leave out keeps its value. Does nothing to a bar that is no longer valid."='Changes what the bar shows. A property the options leave out keeps its value. Does nothing to a bar that is no longer valid.'
BossBar.properties
readonlyproperties:object
BossBar.properties.isValid
readonlyisValid:object
BossBar.properties.isValid.summary
readonlysummary:"Whether the bar is still there: false once it is hidden, once the player leaves and once the pack's scripts stop."="Whether the bar is still there: false once it is hidden, once the player leaves and once the pack's scripts stop."
BossBar.properties.isValid.type
readonlytype:"boolean"='boolean'
BossBar.properties.player
readonlyplayer:object
BossBar.properties.player.summary
readonlysummary:"The player who sees the bar."='The player who sees the bar.'
BossBar.properties.player.type
readonlytype:"Player"='Player'
BossBar.summary
readonlysummary:"A boss bar on one player's screen."="A boss bar on one player's screen."
BossBarColor
readonlyBossBarColor:object
BossBarColor.kind
readonlykind:"union"='union'
BossBarColor.summary
readonlysummary:"A boss bar's color."="A boss bar's color."
BossBarColor.values
readonlyvalues: readonly ["pink","blue","red","green","yellow","purple","rebeccaPurple","white"]
BossBarOptions
readonlyBossBarOptions:object
BossBarOptions.kind
readonlykind:"interface"='interface'
BossBarOptions.properties
readonlyproperties:object
BossBarOptions.properties.color
readonlycolor:object
BossBarOptions.properties.color.optional
readonlyoptional:true=true
BossBarOptions.properties.color.summary
readonlysummary:"The bar's color. Pink when a bar is shown without it."="The bar's color. Pink when a bar is shown without it."
BossBarOptions.properties.color.type
readonlytype:"BossBarColor"='BossBarColor'
BossBarOptions.properties.progress
readonlyprogress:object
BossBarOptions.properties.progress.optional
readonlyoptional:true=true
BossBarOptions.properties.progress.summary
readonlysummary:"How full the bar is, from 0 to 1, clamped to that range. Full when a bar is shown without it."='How full the bar is, from 0 to 1, clamped to that range. Full when a bar is shown without it.'
BossBarOptions.properties.progress.type
readonlytype:"number"='number'
BossBarOptions.properties.text
readonlytext:object
BossBarOptions.properties.text.optional
readonlyoptional:true=true
BossBarOptions.properties.text.summary
readonlysummary:"The title above the bar. Empty when a bar is shown without it."='The title above the bar. Empty when a bar is shown without it.'
BossBarOptions.properties.text.type
readonlytype:"string"='string'
BossBarOptions.summary
readonlysummary:"What a boss bar shows."='What a boss bar shows.'
LevelCreateOptions
readonlyLevelCreateOptions:object
LevelCreateOptions.kind
readonlykind:"interface"='interface'
LevelCreateOptions.properties
readonlyproperties:object
LevelCreateOptions.properties.preset
readonlypreset:object
LevelCreateOptions.properties.preset.optional
readonlyoptional:true=true
LevelCreateOptions.properties.preset.summary
readonlysummary:"The world preset, such as `minecraft:flat`. `minecraft:normal` when left out."='The world preset, such as `minecraft:flat`. `minecraft:normal` when left out.'
LevelCreateOptions.properties.preset.type
readonlytype:"string"='string'
LevelCreateOptions.properties.seed
readonlyseed:object
LevelCreateOptions.properties.seed.optional
readonlyoptional:true=true
LevelCreateOptions.properties.seed.summary
readonlysummary:"The world seed, read as `config.json` reads one. A random seed when left out."='The world seed, read as `config.json` reads one. A random seed when left out.'
LevelCreateOptions.properties.seed.type
readonlytype:"string"='string'
LevelCreateOptions.summary
readonlysummary:"The world a new level gets."='The world a new level gets.'
LevelInfo
readonlyLevelInfo:object
LevelInfo.kind
readonlykind:"interface"='interface'
LevelInfo.properties
readonlyproperties:object
LevelInfo.properties.attached
readonlyattached:object
LevelInfo.properties.attached.summary
readonlysummary:"Whether the level is attached, so players can be in it."='Whether the level is attached, so players can be in it.'
LevelInfo.properties.attached.type
readonlytype:"boolean"='boolean'
LevelInfo.properties.entry
readonlyentry:object
LevelInfo.properties.entry.summary
readonlysummary:"Whether players join the server in this level."='Whether players join the server in this level.'
LevelInfo.properties.entry.type
readonlytype:"boolean"='boolean'
LevelInfo.properties.id
readonlyid:object
LevelInfo.properties.id.summary
readonlysummary:"The level's UUID, which stays the same across restarts and renames."="The level's UUID, which stays the same across restarts and renames."
LevelInfo.properties.id.type
readonlytype:"string"='string'
LevelInfo.properties.name
readonlyname:object
LevelInfo.properties.name.summary
readonlysummary:"The level's name."="The level's name."
LevelInfo.properties.name.type
readonlytype:"string"='string'
LevelInfo.properties.players
readonlyplayers:object
LevelInfo.properties.players.summary
readonlysummary:"The names of the players in the level, empty for a detached one."='The names of the players in the level, empty for a detached one.'
LevelInfo.properties.players.type
readonlytype:"readonly string[]"='readonly string[]'
LevelInfo.summary
readonlysummary:"One level, as the server knew it when the pack asked."='One level, as the server knew it when the pack asked.'
LevelTransferOptions
readonlyLevelTransferOptions:object
LevelTransferOptions.kind
readonlykind:"interface"='interface'
LevelTransferOptions.properties
readonlyproperties:object
LevelTransferOptions.properties.toSpawn
readonlytoSpawn:object
LevelTransferOptions.properties.toSpawn.optional
readonlyoptional:true=true
LevelTransferOptions.properties.toSpawn.summary
readonlysummary:"Sends the player to the level's spawn even when they were there before."="Sends the player to the level's spawn even when they were there before."
LevelTransferOptions.properties.toSpawn.type
readonlytype:"boolean"='boolean'
LevelTransferOptions.summary
readonlysummary:"How `levels.transfer` moves a player."='How `levels.transfer` moves a player.'
PermissionsAfterEvents
readonlyPermissionsAfterEvents:object
PermissionsAfterEvents.kind
readonlykind:"interface"='interface'
PermissionsAfterEvents.properties
readonlyproperties:object
PermissionsAfterEvents.properties.permissionsChange
readonlypermissionsChange:object
PermissionsAfterEvents.properties.permissionsChange.summary
readonlysummary:"Fires after any write to the permission files, whoever made it, and after the files are read again on `/reload` or a change on disk."='Fires after any write to the permission files, whoever made it, and after the files are read again on `/reload` or a change on disk.'
PermissionsAfterEvents.properties.permissionsChange.type
readonlytype:"PermissionsChangeSignal"='PermissionsChangeSignal'
PermissionsAfterEvents.summary
readonlysummary:"The events the permission files raise, after the fact."='The events the permission files raise, after the fact.'
PermissionsChangeEvent
readonlyPermissionsChangeEvent:object
PermissionsChangeEvent.kind
readonlykind:"interface"='interface'
PermissionsChangeEvent.properties
readonlyproperties:object
PermissionsChangeEvent.properties.target
readonlytarget:object
PermissionsChangeEvent.properties.target.optional
readonlyoptional:true=true
PermissionsChangeEvent.properties.target.summary
readonlysummary:"The group or the user the write touched. Absent after the files were read again on `/reload` or a change on disk, which may have changed anything."='The group or the user the write touched. Absent after the files were read again on `/reload` or a change on disk, which may have changed anything.'
PermissionsChangeEvent.properties.target.type
readonlytype:"PermissionsChangeTarget"='PermissionsChangeTarget'
PermissionsChangeEvent.summary
readonlysummary:"What a permission change touched."='What a permission change touched.'
PermissionsChangeSignal
readonlyPermissionsChangeSignal:object
PermissionsChangeSignal.kind
readonlykind:"interface"='interface'
PermissionsChangeSignal.methods
readonlymethods:object
PermissionsChangeSignal.methods.subscribe
readonlysubscribe:object
PermissionsChangeSignal.methods.subscribe.parameters
readonlyparameters:"callback: (event: PermissionsChangeEvent) => void"='callback: (event: PermissionsChangeEvent) => void'
PermissionsChangeSignal.methods.subscribe.returns
readonlyreturns:"(event: PermissionsChangeEvent) => void"='(event: PermissionsChangeEvent) => void'
PermissionsChangeSignal.methods.subscribe.summary
readonlysummary:"Calls `callback` after each change, with the player and the group it touched, and returns the callback. A pack's subscriptions end when its scripts stop."="Calls `callback` after each change, with the player and the group it touched, and returns the callback. A pack's subscriptions end when its scripts stop."
PermissionsChangeSignal.methods.unsubscribe
readonlyunsubscribe:object
PermissionsChangeSignal.methods.unsubscribe.parameters
readonlyparameters:"callback: (event: PermissionsChangeEvent) => void"='callback: (event: PermissionsChangeEvent) => void'
PermissionsChangeSignal.methods.unsubscribe.returns
readonlyreturns:"void"='void'
PermissionsChangeSignal.methods.unsubscribe.summary
readonlysummary:"Stops calling a callback `subscribe` returned."='Stops calling a callback `subscribe` returned.'
PermissionsChangeSignal.properties
readonlyproperties:object={}
PermissionsChangeSignal.summary
readonlysummary:"Where a pack subscribes to permission changes."='Where a pack subscribes to permission changes.'
PermissionsChangeTarget
readonlyPermissionsChangeTarget:object
PermissionsChangeTarget.kind
readonlykind:"alias"='alias'
PermissionsChangeTarget.summary
readonlysummary:"The group a group write touched, by name, or the user a user write touched, by the name their record shows, with their `Player` while they are online."='The group a group write touched, by name, or the user a user write touched, by the name their record shows, with their `Player` while they are online.'
PermissionsChangeTarget.type
readonlytype: "{ readonly group: string } | { readonly name: string; readonly player?: Player }" = '{ readonly group: string } | { readonly name: string; readonly player?: Player }'
Player
readonlyPlayer:object
Player.kind
readonlykind:"interface"='interface'
Player.properties
readonlyproperties:object
Player.properties.id
readonlyid:object
Player.properties.id.summary
readonlysummary:"The player's entity id."="The player's entity id."
Player.properties.id.type
readonlytype:"string"='string'
Player.summary
readonlysummary:"A `Player` from `@minecraft/server`. The members take only a real one; this names what they read, so the pack's own `Player` type fits."="A `Player` from `@minecraft/server`. The members take only a real one; this names what they read, so the pack's own `Player` type fits."
ServerListOptions
readonlyServerListOptions:object
ServerListOptions.kind
readonlykind:"interface"='interface'
ServerListOptions.properties
readonlyproperties:object
ServerListOptions.properties.levelName
readonlylevelName:object
ServerListOptions.properties.levelName.optional
readonlyoptional:true=true
ServerListOptions.properties.levelName.summary
readonlysummary:"The second name, without a `;`."='The second name, without a `;`.'
ServerListOptions.properties.levelName.type
readonlytype:"string"='string'
ServerListOptions.properties.maxPlayers
readonlymaxPlayers:object
ServerListOptions.properties.maxPlayers.optional
readonlyoptional:true=true
ServerListOptions.properties.maxPlayers.summary
readonlysummary:"The player limit to show, a whole number from 0 to 2147483647."='The player limit to show, a whole number from 0 to 2147483647.'
ServerListOptions.properties.maxPlayers.type
readonlytype:"number"='number'
ServerListOptions.properties.motd
readonlymotd:object
ServerListOptions.properties.motd.optional
readonlyoptional:true=true
ServerListOptions.properties.motd.summary
readonlysummary:"The MOTD, without a `;`."='The MOTD, without a `;`.'
ServerListOptions.properties.motd.type
readonlytype:"string"='string'
ServerListOptions.properties.onlinePlayers
readonlyonlinePlayers:object
ServerListOptions.properties.onlinePlayers.optional
readonlyoptional:true=true
ServerListOptions.properties.onlinePlayers.summary
readonlysummary:"The online count to show, a whole number from 0 to 2147483647."='The online count to show, a whole number from 0 to 2147483647.'
ServerListOptions.properties.onlinePlayers.type
readonlytype:"number"='number'
ServerListOptions.summary
readonlysummary:"What `serverList.update` changes. A property left out keeps its value."='What `serverList.update` changes. A property left out keeps its value.'
LEVEL_HOST_FUNCTIONS
constLEVEL_HOST_FUNCTIONS: readonly ["levels","currentLevel","levelOf","transferPlayer","createLevel","attachLevel","detachLevel"]
Defined in: script-host/src/host/jsprismarineServer.ts:921
The host functions behind levels, installed only on a server that manages levels.
PERMISSION_HOST_FUNCTIONS
constPERMISSION_HOST_FUNCTIONS: readonly ["hasPermission","groupsOf","primaryGroupOf","metaOf","grant","revoke","grantToGroup","revokeFromGroup","addToGroup","removeFromGroup","onPermissionsChange"]
Defined in: script-host/src/host/jsprismarineServer.ts:906
The host functions behind permissions, installed only on a server that has the permission files.
SERVER_LIST_HOST_FUNCTIONS
constSERVER_LIST_HOST_FUNCTIONS: readonly ["serverListStatus","updateServerList","resetServerList"]
Defined in: script-host/src/host/jsprismarineServer.ts:932
The host functions behind serverList, installed only on a server that advertises a status.
Functions
jsprismarineServerSource()
jsprismarineServerSource(
info):string
Defined in: script-host/src/host/jsprismarineServer.ts:967
The script that evaluates to a function making the module's namespace, run in the pack's context. Called with nothing, the function makes jsprismarine alone; called with an object of the JSPRISMARINE_HOST_FUNCTIONS, it adds the members that reach the running server.
Parameters
info
The server the pack runs on.
Returns
string
A script whose value is that function. The namespace and every object in it are frozen.
jsprismarineServerTypings()
jsprismarineServerTypings():
string
Defined in: script-host/src/host/jsprismarineServer.ts:1129
The declarations a pack's TypeScript sees for @jsprismarine/server and @jsprismarine/placeholders: one ambient module each, so a project that names the typings package in its types gets them for the module names.
Returns
string
The contents of the typings package's index.d.ts.
placeholdersModuleSource()
placeholdersModuleSource():
string
Defined in: script-host/src/host/jsprismarineServer.ts:1011
The script that evaluates to a function making the @jsprismarine/placeholders namespace, run in the pack's context with an object of the JSPRISMARINE_PLACEHOLDERS_HOST_FUNCTIONS.
Returns
string
A script whose value is that function. The namespace and every object in it are frozen.