Skip to main content

Look up a player

The examples use the shared CloudApi client created in Installation and belong inside your plugin’s methods. Prefer a player’s UUID when you know it because usernames can change. Look up a player by UUID and check whether they are online before using their current server:
get(UUID) returns null when SimpleCloud has no stored player with that UUID. You can also look up a player by their case-insensitive username:
A CloudPlayer contains the state recorded when you queried it. Fetch the player again when a later action depends on their current presence.

List online players

Use the online player list when you need the players themselves, or request only the count:
The list is empty and the count is 0 when no players are online.

Inspect player data

Connect a player

Call connect(...) with the server name registered on the player’s proxy, such as lobby-1. Do not pass the server UUID. Connecting players requires the simplecloud-api provider on the Velocity or BungeeCord proxy. See Transfer a player to another server for a complete transfer workflow.

Kick a player

Pass an Adventure component as the reason shown to the player:
Kicking players requires the simplecloud-api provider on the Velocity or BungeeCord proxy.

Send Adventure content

CloudPlayer implements Adventure’s Audience, so you can send messages, action bars, titles, sounds, boss bars, books, and player-list headers and footers.
Remote Adventure content requires the simplecloud-api provider on the player’s Paper or Folia server.

Manage online time and properties

Player properties store custom string values for your plugins. Online time must be between 0 and Integer.MAX_VALUE seconds. The add and remove helpers read the current value before writing the result, so concurrent changes can overwrite one another. Property updates merge the supplied values with the existing map, while delete methods remove only the specified keys. The merged properties must fit within 4 KB when encoded as JSON.