Detect Bedrock Players with Floodgate
BedrockUtils provides a simple way for PaperMC plugins to detect Bedrock players through Geyser and Floodgate.
Instead of accessing the Floodgate API directly throughout your plugin, you can use a single utility method:
if (BedrockUtils.isBedrockPlayer(player)) { // Player joined through Geyser/Floodgate.}This keeps Floodgate-specific integration isolated from the rest of your plugin code.
Check whether a player is on Bedrock
Section titled “Check whether a player is on Bedrock”Use BedrockUtils.isBedrockPlayer(Player) to determine whether a player was identified by Floodgate:
Player player = event.getPlayer();
if (BedrockUtils.isBedrockPlayer(player)) { player.sendMessage( Component.text("Welcome, Bedrock player!") );}The method returns:
| Result | Meaning |
|---|---|
true |
The player was identified as a Floodgate player. |
false |
The player is not a Floodgate player, or Floodgate is unavailable. |
This makes the method suitable for conditional behavior such as Bedrock-specific messages, interfaces, or gameplay handling.
Floodgate is optional
Section titled “Floodgate is optional”Floodgate is an optional dependency.
BedrockUtils checks whether Floodgate is enabled before accessing its API.
If Floodgate is not installed, isBedrockPlayer(...) returns false.
This allows a Paper plugin to use the utility without making Floodgate a required dependency.
Configure Floodgate in paper-plugin.yml
Section titled “Configure Floodgate in paper-plugin.yml”To allow BedrockUtils to access Floodgate when it is installed, declare Floodgate as an optional dependency in paper-plugin.yml:
dependencies:bootstrap: floodgate: load: BEFORE required: false join-classpath: trueserver: floodgate: load: BEFORE required: false join-classpath: trueBoth the bootstrap and server dependency entries are required for the integration.
The dependency remains optional because both entries use:
required: falsejoin-classpath: true makes Floodgate’s classes available to the plugin when Floodgate is installed.
Why use BedrockUtils?
Section titled “Why use BedrockUtils?”A plugin can access Floodgate directly:
FloodgateApi.getInstance() .isFloodgatePlayer(player.getUniqueId());With Reedwork, the application code can instead use:
BedrockUtils.isBedrockPlayer(player);This keeps the Floodgate API out of the rest of the plugin and gives the application a small, focused API for Bedrock player detection.
isBedrockPlayer(Player player)
Section titled “isBedrockPlayer(Player player)”Checks whether the specified player joined through Floodgate.
Parameters:
| Parameter | Type | Description |
|---|---|---|
player |
Player |
The player to check. |
Returns:
true if the player is identified as a Floodgate player; otherwise false.
If Floodgate is unavailable, the method also returns false.
When to use BedrockUtils
Section titled “When to use BedrockUtils”BedrockUtils is useful when a Paper plugin needs to distinguish between Java Edition and Bedrock players.
Typical use cases include:
- Bedrock-specific player messages
- platform-specific UI or interaction
- different gameplay behavior
- logging the player’s platform
- optional Geyser/Floodgate integration
The utility intentionally provides only the Bedrock detection layer. Other Floodgate functionality can still be accessed directly when a plugin requires features that BedrockUtils does not expose.
Related utilities
Section titled “Related utilities”For other PaperMC and Bukkit utilities, see the Reedwork utility collection.
You can also explore Color Utilities for color and Adventure text operations.