Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Contains types related to administering a Bedrock Dedicated Server. These types allow for the configuration of variables and secrets in JSON files in the Bedrock Dedicated Server folder. These types cannot be used on Minecraft clients or within Minecraft Realms.
Caution
This module is still in pre-release. It may change or it may be removed in future releases.
Changelog
Manifest Details
{
"module_name": "@minecraft/server-admin",
"version": "1.0.0-beta"
}
This is version 1.x.x of this module, which is the latest as of version 1.26.30-beta.20 of Minecraft.
Available Versions
1.0.0-beta
Classes
- AdminBeforeEvents
- AllowList
- AsyncPlayerJoinBeforeEvent
- AsyncPlayerJoinBeforeEventSignal
- DedicatedServerUtils
- LevelStorage
- LevelStorageQuerySnapshotFile
- SecretString
- ServerSecrets
- ServerVariables
Interfaces
Errors
- AllowListFileReloadError
- AllowListModificationError
- CannotDeopPlayerError
- CannotKickPlayerError
- DisconnectedError
- LevelStorageSaveStateChangeError
- PlayerAlreadyOpError
Functions
deopPlayer
deopPlayer(player: minecraftserver.Player): void
Removes the player's op permissions.
Parameters
player: @minecraft/server.Player
Player to remove permissions from.
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
kickPlayer
kickPlayer(player: minecraftserver.Player, reason?: string): void
Kicks a player from the server.
Parameters
player: @minecraft/server.Player
Player to kick.
reason?: string = ``
Reason for kicking the player.
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
opPlayer
opPlayer(player: minecraftserver.Player): void
Gives the player op permissions.
Parameters
player: @minecraft/server.Player
Player to add permissions to.
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
transferPlayer
transferPlayer(player: minecraftserver.Player, options: TransferPlayerIpPortOptions | TransferPlayerNetherNetOptions): void
Transfer player to another server.
Parameters
player: @minecraft/server.Player
Player to transfer.
options: TransferPlayerIpPortOptions | TransferPlayerNetherNetOptions
Options for where to send the player.
Notes:
- This function can't be called in restricted-execution mode.
- This function can throw errors.
Objects
beforeEvents
static read-only beforeEvents: AdminBeforeEvents;
Type: AdminBeforeEvents
dedicatedServer
static read-only dedicatedServer: DedicatedServerUtils | undefined;
A globally available, optional object that contains dedicated-server only apis.
Type: DedicatedServerUtils
secrets
static read-only secrets: ServerSecrets;
A globally available object that returns a list of dedicated-server configured secrets.
Type: ServerSecrets
variables
static read-only variables: ServerVariables;
A globally available object that returns a list of dedicated-server configured variables.
Type: ServerVariables