2021-12-12 14:16:38 +00:00
---
title : Floodgate API
---
2023-11-07 20:24:02 -06:00
Floodgate has an API to extend what is possible and allow servers to get information about the Bedrock client. It also allows other plugins access to [Cumulus ](/geyser/forms/ )
2021-12-12 14:16:38 +00:00
2023-11-07 19:40:55 -06:00
This page will contain information about class FloodgateApi.
2021-12-12 14:16:38 +00:00
See the sidebar for more information about other parts of the API.
### Accessing the Floodgate API
2023-07-09 17:49:13 +02:00
See [here ](/geyser/getting-started-with-the-api ) for how to include the Floodgate API in your project.
2021-12-12 14:16:38 +00:00
2023-11-07 20:24:02 -06:00
2021-12-12 14:16:38 +00:00
The Floodgate API has changed in Floodgate 2.0. The most important change is that the API methods are no longer static and instead instance-based, as shown below.
2023-11-07 19:40:55 -06:00
The class FloodgateApi is the base class of the API and you need to use it to access any part of the API.
2021-12-12 14:16:38 +00:00
To access it, you simply type:
```java
FloodgateApi . getInstance ();
```
2023-11-07 19:40:55 -06:00
After you got the instance, you have access to all the methods.
2021-12-12 14:16:38 +00:00
Use the documentation in the API module to see (and get info about) every single method available.
Most [API methods have a simple explanation ](https://github.com/GeyserMC/Floodgate/tree/master/api/src/main/java/org/geysermc/floodgate/api ).
2023-11-07 19:40:55 -06:00
:::note
To see full, detailed documentation, see the [javadocs ](https://repo.opencollab.dev/javadoc/maven-snapshots/org/geysermc/floodgate/api/2.2.2-SNAPSHOT ).
:::
2023-07-09 17:49:13 +02:00
2022-02-20 12:11:41 +00:00
#### We'll highlight a few to get you started quickly:
2023-11-07 19:40:55 -06:00
`FloodgateApi#isFloodgatePlayer(UUID)`
2021-12-12 14:16:38 +00:00
Used to check if the given UUID of an **online** player is a Bedrock player.
2023-11-07 19:40:55 -06:00
`FloodgateApi#getPlayer(UUID)`
Used to get the FloodgatePlayer instance of an **online** player.
2022-02-20 12:51:51 +00:00
Click [here ](/floodgate/player/ ) to get more information about the FloodgatePlayer class.
2021-12-12 14:16:38 +00:00
2023-11-07 19:40:55 -06:00
**Note** : You don't need to wait until the Bedrock player is online to use the getPlayer and isFloodgatePlayer methods.
2021-12-12 14:16:38 +00:00
You can even use them in the pre-login events.
2023-11-07 19:40:55 -06:00
`FloodgateApi#getPlayerLink()`
Used to get the PlayerLink instance used by Floodgate to check for linked accounts.
2022-02-20 12:51:51 +00:00
Click [here ](/floodgate/linking/ ) to get more information about the PlayerLink class
2021-12-12 14:16:38 +00:00
2023-11-07 19:40:55 -06:00
`FloodgateApi#sendForm(UUID, Form(Builder))`
Used to send a form to the Bedrock player with the given UUID.
2023-07-09 17:49:13 +02:00
Click [here ](/geyser/forms/ ) to get more information about Forms.
2021-12-12 14:16:38 +00:00
### Using the API on backend servers
In order to successfully use the API on backend Spigot servers when using a proxy, `send-floodgate-data` must be set to `true` on the proxy Floodgate's config, and the `key.pem` file must be identical between all Floodgate instances.