Usernames of who is allowed to build in the level. BaseLevel.userHasPermission checks against this list. If empty, everyone is allowed.
The buffer representing the level's blocks.
The bounds of the level.
Drones which are linked to clients in the level.
The set of drones currently in the level.
The players currently in the level.
StaticblocksetDefines the block set used in the level.
StaticboundsStaticcommandThe default BaseLevelCommandInterpreter class for the level.
StaticcommandsStaticdefaultStaticenvironmentDefines the environmental properties of the level, such as sky and cloud settings.
StaticstandardDeprecated. Use BaseLevel.bounds instead.
StatictemplateThe template used to generate the level's blocks.
Adds a player to the level.
The player to be added.
Destroys the level, releasing any resources used for it.
OptionalsaveChanges: boolean = trueIf true, I will flush any pending block changes to my ChangeRecord before disposing it. Default is true
Gets the block type at the specified position in the level.
The position to get the block from.
The block type at the specified position.
Sends the level data to the specified player. This is typically called on BaseLevel.addPlayer.
Optionalposition: Vector3 = ...Default is [0,0,0]
Optionalorientation: Vector2 = ...Default is [0,0]
Sets a block at the specified position in the level without notifying players.
The position to set the block at.
The block type to set.
Reloads all players in the level, typically used to refresh the level's state.
The player to send the drones to.
Sets a block at the specified position in the level.
The position to set the block at.
The block type to set.
OptionalexcludePlayers: BasePlayer[] = []Default is []
OptionalsaveToRecord: boolean = trueDefault is true
Checks if a user has permission to edit the level.
The username to check.
Whether the user has permission.
Checks if a position is within the level bounds.
The position to check.
Whether the position is within the level bounds.
StaticgetStaticloadLoads a level into a BaseUniverse instance, creating it if it doesn't exist.
The universe to load the level into.
The identifier of the level. This will be used for BaseUniverse.levels.
The default properties for the level.
A promise that resolves to the loaded level.
StaticsendSends a block set to a client.
The client to send the block set to.
The block set to send.
StaticteleportTeleports the player into the level. If level currently doesn't exist in universe, it'll be created.
Levels extending Level are expected to override this method using this pattern:
static async teleportPlayer(player, spaceName) {
if (super.teleportPlayer(player) === false) return // Removes player from any levels they are in. If it returns false, the player is still being teleported somewhere.
Level.loadIntoUniverse(player.universe, spaceName, { // Create the level using its desired defaults.
levelClass: HubLevel,
}).then(async (level) => { // Add player after it loads.
level.addPlayer(player, [60, 8, 4], [162, 254])
})
}
The player to teleport.
OptionalspaceName: stringThe identifier of the level to teleport to. Default is null
Optionaldefaults: {} = {}Default is {}
Todo
Yet to be documented.
Template: E