# Player Executor

### 1. Methods

#### **1.1 `getPlayer(String)`**

```java
WalePlayer getPlayer(String uuid);
```

**Description:**\
This method is used to retrieve player information based on the UUID as a string.

#### **1.2 `getPlayer(UUID)`**

```java
WalePlayer getPlayer(UUID uuid);
```

**Description:**\
This method is used to retrieve player information based on the UUID.

#### **1.3 `getPlayerByName(String)`**

```java
WalePlayer getPlayerByName(String name);
```

**Description:**\
This method is used to retrieve player information based on the player name.

#### **1.4 `getPlayerCounts()`**

```java
KeyValuePair<Integer, Integer> getPlayerCounts();
```

**Description:**\
This method is used to retrieve the number of players (current, max).

#### **1.5 `connect(String, String)`**

```java
void connect(String uuid, String serviceId);
```

**Description:**\
This method is used to connect a player to a service.

#### **1.6 `disconnect(String, String)`**

```java
void disconnect(String uuid, String parsedBaseComponent)
```

{% hint style="info" %}
In the API, you will often encounter *`parsedBaseComponent`* or similar terms. This refers to the BaseComponents of Bungee-Chat in JSON format. There is a *ComponentSerializer* provided by BungeeCord that can directly build these components into JSON format.
{% endhint %}

**Description:**\
This method is used to disconnect a player from the BungeeCord server.

#### **1.7 `sendMesasge(String, String)`**

```java
void sendMessage(String uuid, String message);
```

**Description:**\
This method is used to send a chat message to the player.

#### **1.8 `sendMesasge(String, String[])`**

```java
void sendMessage(String uuid, String[] message);
```

**Description:**\
This method is used to send multiple chat messages to the player.

#### **1.9 `broadcastMessage(String[], String[])`**

```java
void broadcastMessage(String[] message, String[] permissions);
```

**Description:**\
This method is used to send multiple chat messages to all players. Permissions are optional.

#### **1.10 `broadcastMessage(String, String[])`**

```java
void broadcastMessage(String message, String[] permissions);
```

**Description:**\
This method is used to send a chat message to all players. Permissions are optional.

#### **1.11 `broadcastMessage(String, String[])`**

```java
void broadcastMessage(String message, String[] permissions);
```

**Description:**\
This method is used to send a chat message to all players. Permissions are optional.

#### **1.12 `broadcastBaseComponents(String[], String[])`**

```java
void broadcastBaseComponents(String[] parsedBaseComponents, String[] permissions);
```

**Description:**\
This method is used to send `BaseComponents` to all players. Permissions are optional.

#### **1.13 `broadcastBaseComponents(String, String[])`**

```java
void broadcastBaseComponents(String parsedBaseComponents, String[] permissions);
```

**Description:**\
This method is used to send a single `BaseComponent` to all players. Permissions are optional.

#### **1.14 `sendBaseComponents(String, String)`**

```java
void sendBaseComponents(String uuid, String parsedBaseComponents);
```

**Description:**\
This method is used to send a `BaseComponent` to a specific player using their UUID as a string.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.walecloud.com/api-documentation/executors/player-executor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
