fetchCharacters
Retrieves all survivors for the server. The optional playerId
parameter allows the results to be filtered to a specific player. Remember that a player can have more than one survivor, though only one can be alive at a time.
Signatures
beacon.fetchCharacters();
beacon.fetchCharacters(playerId);
Parameters
playerId
The Sentinel UUID of the desired player.
Return Values
Type | Notes |
---|---|
Array | An array of Character objects. It is possible for the array to be empty. |
Examples
Fetch all survivors on the server
const characters = beacon.fetchCharacters();
Fetch survivors for a player that joined the server
const characters = beacon.fetchCharacters(beacon.eventData.playerId);