discord-mcbe
Preparing search index...
@discord-mcbe/client
local
WebSocketBridgeClient
Class WebSocketBridgeClient
Hierarchy
Emitter
<
WebSocketBridgeEvents
>
WebSocketBridgeClient
Implements
IBridgeClient
Index
Constructors
constructor
Properties
PROTOCOL_
VERSION
Accessors
is
Connected
world
Name
Methods
destroy
disconnect
emit
notify
off
on
once
remove
All
Listeners
request
Constructors
constructor
new
WebSocketBridgeClient
(
options
:
WebSocketBridgeClientOptions
,
)
:
WebSocketBridgeClient
Parameters
options
:
WebSocketBridgeClientOptions
Returns
WebSocketBridgeClient
Properties
Static
Readonly
PROTOCOL_
VERSION
PROTOCOL_VERSION
:
3
= WEBSOCKET_BRIDGE_PROTOCOL_VERSION
Accessors
is
Connected
get
isConnected
()
:
boolean
Returns
boolean
world
Name
get
worldName
()
:
string
Returns
string
Methods
destroy
destroy
()
:
void
Returns
void
disconnect
disconnect
(
reason
?:
DisconnectReason
)
:
Promise
<
void
>
Parameters
reason
:
DisconnectReason
= DisconnectReason.Disconnect
Returns
Promise
<
void
>
emit
emit
<
K
extends
keyof
WebSocketBridgeEvents
>
(
event
:
K
,
data
:
WebSocketBridgeEvents
[
K
]
,
)
:
void
Type Parameters
K
extends
keyof
WebSocketBridgeEvents
Parameters
event
:
K
data
:
WebSocketBridgeEvents
[
K
]
Returns
void
notify
notify
(
packet
:
|
{
data
:
{
player
:
{
name
:
string
;
nameTag
:
string
;
pfid
:
string
&
{
__brand
:
"Pfid"
}
;
platformType
:
PlatformType
;
uniqueId
:
string
&
{
__brand
:
"UniqueId"
}
;
}
;
}
;
type
:
PlayerJoin
;
}
|
{
data
:
{
playerUniqueId
:
string
&
{
__brand
:
"UniqueId"
}
}
;
type
:
PlayerLeave
;
}
|
{
data
:
{
cause
:
EntityDamageCause
;
damagingEntity
?:
|
{
isPlayer
:
true
;
localizationKey
:
string
;
name
:
string
;
nameTag
:
string
;
typeId
:
string
;
}
|
{
isPlayer
:
false
;
localizationKey
:
string
;
nameTag
?:
string
;
typeId
:
string
;
}
;
playerUniqueId
:
string
&
{
__brand
:
"UniqueId"
}
;
}
;
type
:
PlayerDie
;
}
|
{
data
:
{
formatting
?:
{
messagePrefix
?:
string
;
messageSuffix
?:
string
;
namePrefix
?:
string
;
nameSuffix
?:
string
;
}
;
message
:
string
;
senderName
:
string
;
senderUniqueId
:
string
&
{
__brand
:
"UniqueId"
}
;
source
?:
string
;
}
;
type
:
ChatSend
;
}
|
{
data
:
{
message
:
v.CustomSchema
<
DiscordMessageJSON
,
undefined
>
;
source
:
string
;
}
;
type
:
DiscordSend
;
}
,
)
:
void
Parameters
packet
:
|
{
data
:
{
player
:
{
name
:
string
;
nameTag
:
string
;
pfid
:
string
&
{
__brand
:
"Pfid"
}
;
platformType
:
PlatformType
;
uniqueId
:
string
&
{
__brand
:
"UniqueId"
}
;
}
;
}
;
type
:
PlayerJoin
;
}
|
{
data
:
{
playerUniqueId
:
string
&
{
__brand
:
"UniqueId"
}
}
;
type
:
PlayerLeave
;
}
|
{
data
:
{
cause
:
EntityDamageCause
;
damagingEntity
?:
|
{
isPlayer
:
true
;
localizationKey
:
string
;
name
:
string
;
nameTag
:
string
;
typeId
:
string
;
}
|
{
isPlayer
:
false
;
localizationKey
:
string
;
nameTag
?:
string
;
typeId
:
string
;
}
;
playerUniqueId
:
string
&
{
__brand
:
"UniqueId"
}
;
}
;
type
:
PlayerDie
;
}
|
{
data
:
{
formatting
?:
{
messagePrefix
?:
string
;
messageSuffix
?:
string
;
namePrefix
?:
string
;
nameSuffix
?:
string
;
}
;
message
:
string
;
senderName
:
string
;
senderUniqueId
:
string
&
{
__brand
:
"UniqueId"
}
;
source
?:
string
;
}
;
type
:
ChatSend
;
}
|
{
data
:
{
message
:
v.CustomSchema
<
DiscordMessageJSON
,
undefined
>
;
source
:
string
;
}
;
type
:
DiscordSend
;
}
Returns
void
off
off
<
K
extends
keyof
WebSocketBridgeEvents
>
(
event
:
K
,
listener
:
Listener
<
WebSocketBridgeEvents
[
K
]
>
,
)
:
void
Type Parameters
K
extends
keyof
WebSocketBridgeEvents
Parameters
event
:
K
listener
:
Listener
<
WebSocketBridgeEvents
[
K
]
>
Returns
void
on
on
<
K
extends
keyof
WebSocketBridgeEvents
>
(
event
:
K
,
listener
:
Listener
<
WebSocketBridgeEvents
[
K
]
>
,
)
:
void
Type Parameters
K
extends
keyof
WebSocketBridgeEvents
Parameters
event
:
K
listener
:
Listener
<
WebSocketBridgeEvents
[
K
]
>
Returns
void
once
once
<
K
extends
keyof
WebSocketBridgeEvents
>
(
event
:
K
,
listener
:
Listener
<
WebSocketBridgeEvents
[
K
]
>
,
)
:
void
Type Parameters
K
extends
keyof
WebSocketBridgeEvents
Parameters
event
:
K
listener
:
Listener
<
WebSocketBridgeEvents
[
K
]
>
Returns
void
remove
All
Listeners
removeAllListeners
<
K
extends
keyof
WebSocketBridgeEvents
>
(
event
:
K
)
:
void
Type Parameters
K
extends
keyof
WebSocketBridgeEvents
Parameters
event
:
K
Returns
void
request
request
(
packet
:
|
Omit
<
{
data
:
{
protocolVersion
:
number
;
worldName
:
string
}
;
requestId
:
string
;
type
:
Connect
;
}
,
"requestId"
,
>
|
Omit
<
{
data
:
{
reason
:
DisconnectReason
}
;
requestId
:
string
;
type
:
Disconnect
;
}
,
"requestId"
,
>
|
Omit
<
{
data
:
{
players
:
{
name
:
string
;
nameTag
:
string
;
pfid
:
string
&
{
__brand
:
"Pfid"
}
;
platformType
:
PlatformType
;
uniqueId
:
string
&
{
__brand
:
"UniqueId"
}
;
}
[]
;
}
;
requestId
:
string
;
type
:
WorldInitialize
;
}
,
"requestId"
,
>
,
)
:
Promise
<
RequestResult
<
unknown
>
>
Parameters
packet
:
|
Omit
<
{
data
:
{
protocolVersion
:
number
;
worldName
:
string
}
;
requestId
:
string
;
type
:
Connect
;
}
,
"requestId"
,
>
|
Omit
<
{
data
:
{
reason
:
DisconnectReason
}
;
requestId
:
string
;
type
:
Disconnect
;
}
,
"requestId"
,
>
|
Omit
<
{
data
:
{
players
:
{
name
:
string
;
nameTag
:
string
;
pfid
:
string
&
{
__brand
:
"Pfid"
}
;
platformType
:
PlatformType
;
uniqueId
:
string
&
{
__brand
:
"UniqueId"
}
;
}
[]
;
}
;
requestId
:
string
;
type
:
WorldInitialize
;
}
,
"requestId"
,
>
Returns
Promise
<
RequestResult
<
unknown
>
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
PROTOCOL_
VERSION
Accessors
is
Connected
world
Name
Methods
destroy
disconnect
emit
notify
off
on
once
remove
All
Listeners
request
discord-mcbe
Loading...