PlayerManager
The manager that keeps track of all players.
warning
You should never have to construct this class yourself.
import { client } from 'beapi-core';
client.players...;
Constructor
new PlayerManager(client);
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
client | Client | ❌ | null | Constructed Client instance. |
Methods
create
Creates a Player instance.
create(player);
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
player | IPlayer | ❌ | undefined | Player to create. |
Returns
add
Adds a player to the manager.
add(player);
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
player | Player | ❌ | undefined | Player to add. |
Returns
void
remove
Removes a player from the manager.
remove(player);
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
player | Player | ❌ | undefined | Player to remove. |
Returns
void
removeByName
Removes a player from the manager by their name.
removeByName(name);
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
name | string | ❌ | undefined | Player to remove. |
Returns
void
getAll
Returns all players as a map.
getAll();
Returns
getByName
Returns a player their name.
getByName(name);
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
name | string | ❌ | undefined | Player to get. |
Returns
getByNameTag
Returns a player their nameTag.
getByNameTag(name);
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
name | string | ❌ | undefined | Player to get. |
Returns
getByIPlayer
Returns a player their IPlayer.
getByIPlayer(player);
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
player | IPlayer | ❌ | undefined | Player to get. |