Skip to main content

WorldManager

The main world object for BeAPI

warning

You should never have to construct this class yourself.

import { client } from 'beapi-core';

client.world...;

Constructor​

new WorldManager(client, player);
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
clientClient❌nullConstructed Client instance.

Methods​

sendMessage​

Sends a message to every player.

sendMessage(message);
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
messagestring❌undefinedMessage to send.

Returns​

void


getEntitiesFromLocation​

Gets all the entities in a specific location.

getEntitiesFromLocation(dimension, location);
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
dimensionDimension❌undefinedDimension to locate in.
locationLocation❌undefinedLocation to check.

Returns​

Entity[]


getPlayersFromLocation​

Gets all the players in a specific location.

getPlayersFromLocation(dimension, location);
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
dimensionDimension❌undefinedDimension to locate in.
locationLocation❌undefinedLocation to check.

Returns​

Player[]


spawnEntity​

Spawns an entity.

spawnEntity(entity, location, name);
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
entitystring❌undefinedEntity id.
locationLocation❌undefinedLocation to summon.
namestring❌undefinedName of the entity.

Returns​

Entity | undefined


getBlock​

Gets a block from the world.

getBlock(dimension, location);
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
dimensionDimension❌undefinedDimension to locate in.
locationLocation❌undefinedLocation to check.

Returns​

Block