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);
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| client | Client | ❌ | null | Constructed Client instance. |
Methods
sendMessage
Sends a message to every player.
sendMessage(message);
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| message | string | ❌ | undefined | Message to send. |
Returns
void
getEntitiesFromLocation
Gets all the entities in a specific location.
getEntitiesFromLocation(dimension, location);
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| dimension | Dimension | ❌ | undefined | Dimension to locate in. |
| location | Location | ❌ | undefined | Location to check. |
Returns
getPlayersFromLocation
Gets all the players in a specific location.
getPlayersFromLocation(dimension, location);
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| dimension | Dimension | ❌ | undefined | Dimension to locate in. |
| location | Location | ❌ | undefined | Location to check. |
Returns
spawnEntity
Spawns an entity.
spawnEntity(entity, location, name);
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| entity | string | ❌ | undefined | Entity id. |
| location | Location | ❌ | undefined | Location to summon. |
| name | string | ❌ | undefined | Name of the entity. |
Returns
getBlock
Gets a block from the world.
getBlock(dimension, location);
| PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| dimension | Dimension | ❌ | undefined | Dimension to locate in. |
| location | Location | ❌ | undefined | Location to check. |