API reference / @jsprismarine/prismarine / scripting/ScriptDebugger
scripting/ScriptDebugger
Classes
Interfaces
DebuggableScripts
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:52
The scripts a debugger attaches to.
Methods
plugins()
plugins(): readonly
DebuggerPlugin[]
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:54
The packs the extension may pick, as the protocol event lists them.
Returns
readonly DebuggerPlugin[]
target()
target(
moduleUuid):ScriptDebugTargetPack|undefined
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:56
The pack whose script module has moduleUuid, while it runs.
Parameters
moduleUuid
string
Returns
ScriptDebugTargetPack | undefined
ScriptDebugTargetPack
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:45
A pack the extension can debug: where its scripts run, and its files.
Properties
context
readonlycontext:number
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:47
engine
readonlyengine:ScriptEngine
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:46
pack
readonlypack:ScriptPack
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:48
ScriptDebuggerHost
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:32
The script host modules the debugger runs, which the caller imports.
Properties
DebuggerThread
readonlyDebuggerThread: typeofDebuggerThread
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:35
DEFAULT_DEBUGGER_PORT
readonlyDEFAULT_DEBUGGER_PORT:number
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:39
The port the extension and BDS use when none is given.
LogLevel
readonlyLogLevel:object
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:37
LogLevel of the extension's protocol.
error
readonlyerror:number
log
readonlylog:number
warn
readonlywarn:number
PortDebuggerChannel
readonlyPortDebuggerChannel: typeofPortDebuggerChannel
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:34
readPackFile
readonlyreadPackFile: (pack,path) =>string|undefined
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:41
Reads a file of a pack, by its path relative to the pack; undefined outside it or when missing.
Parameters
pack
path
string
Returns
string | undefined
ScriptDebugSession
readonlyScriptDebugSession: typeofScriptDebugSession
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:33
ScriptDebuggerOptions
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:60
What the debugger needs from the server.
Properties
host
readonlyhost:ScriptDebuggerHost
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:63
log
readonlylog:ScriptLog
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:65
The server's log, which gets BDS's lines.
replay
readonlyreplay:boolean
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:67
Whether the server replays a recorded session, when the debugger never opens a socket.
runCommand?
readonlyoptionalrunCommand?: (command,dimension) =>void
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:72
Runs a command the extension's command box sent, in a dimension the extension names, such as overworld. It runs between ticks, never inside a script.
Parameters
command
string
dimension
string
Returns
void
scripts
readonlyscripts:DebuggableScripts
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:62
settings
readonlysettings:ScriptDebuggerConfig
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:61
sleep?
readonlyoptionalsleep?: (seconds) =>Promise<void>
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:77
Resolves after seconds, for auto-attach's timeout and its retries. It waits on the wall clock only at startup, before the first tick, where nothing simulated reads it.
Parameters
seconds
number
Returns
Promise<void>
Type Aliases
ScriptDebuggerReply
ScriptDebuggerReply = {
message:string;ok:boolean; } |undefined
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:81
What a /script debugger command prints: feedback, an error, or nothing, as on BDS.
Variables
DEFAULT_CONNECT_HOST
constDEFAULT_CONNECT_HOST:"localhost"='localhost'
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:106
The host /script debugger connect reaches when it names none.
ScriptDebuggerMessages
constScriptDebuggerMessages:object
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:84
The lines BDS prints for the debugger, from the pinned server's binary and its en_US.lang.
Type Declaration
attached
readonlyattached: (address,port) =>string
Parameters
address
string
port
number
Returns
string
autoAttachBadAddress
readonlyautoAttachBadAddress:"Debugger auto-attach failed, outbound address or port is not valid."='Debugger auto-attach failed, outbound address or port is not valid.'
autoAttachInboundDisabled
readonlyautoAttachInboundDisabled:"Debugger auto-attach failed, inbound connections are disabled."='Debugger auto-attach failed, inbound connections are disabled.'
autoAttachNoConnection
readonlyautoAttachNoConnection:"Debugger auto-attach did not connect."='Debugger auto-attach did not connect.'
autoAttachOutboundDisabled
readonlyautoAttachOutboundDisabled:"Debugger auto-attach failed, outbound connections are disabled."='Debugger auto-attach failed, outbound connections are disabled.'
autoAttachStillListening
readonlyautoAttachStillListening:"Debugger auto-attach did not connect, but is still listening."='Debugger auto-attach did not connect, but is still listening.'
autoAttachWaiting
readonlyautoAttachWaiting: (seconds) =>string
Parameters
seconds
number
Returns
string
closed
readonlyclosed:"Debugger closed"='Debugger closed'
connected
readonlyconnected: (host,port) =>string
Parameters
host
string
port
number
Returns
string
connectionClosed
readonlyconnectionClosed:"Debugger connection closed."='Debugger connection closed.'
failed
readonlyfailed:"Failed to start debugger"='Failed to start debugger'
inboundDisabled
readonlyinboundDisabled:"Inbound connections are disabled"='Inbound connections are disabled'
invalidConnectAddress
readonlyinvalidConnectAddress:"Invalid script debugger connect address, format must be host:port with port in the range [ 1, 65535 ]"='Invalid script debugger connect address, format must be host:port with port in the range [ 1, 65535 ]'
invalidPort
readonlyinvalidPort: (port,fallback) =>string
Parameters
port
number
fallback
number
Returns
string
listening
readonlylistening: (port) =>string
Parameters
port
number
Returns
string
outboundDisabled
readonlyoutboundDisabled:"Outbound connections are disabled"='Outbound connections are disabled'
Functions
parseConnectAddress()
parseConnectAddress(
address): {host:string;port:number; } |undefined
Defined in: packages/prismarine/src/scripting/ScriptDebugger.ts:121
Reads script-debugger-auto-attach-connect-address, host:port.
Parameters
address
string
Returns
{ host: string; port: number; } | undefined
The host and port, or undefined when the text is not that form or the port is out of range.