Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/BG-Software-LLC/SuperiorSkyblock2/llms.txt

Use this file to discover all available pages before exploring further.

The SuperiorPlayer interface is the primary way to interact with players in SuperiorSkyblock2. It wraps Bukkit’s player object and provides extensive functionality for managing player data, islands, permissions, preferences, and more.

Getting a SuperiorPlayer

import com.bgsoftware.superiorskyblock.api.SuperiorSkyblockAPI;
import com.bgsoftware.superiorskyblock.api.wrappers.SuperiorPlayer;

// From a Bukkit Player object
Player player = ...;
SuperiorPlayer superiorPlayer = SuperiorSkyblockAPI.getPlayer(player);

// From a UUID
UUID uuid = ...;
SuperiorPlayer superiorPlayer = SuperiorSkyblockAPI.getPlayer(uuid);

// From a player name
String name = "PlayerName";
SuperiorPlayer superiorPlayer = SuperiorSkyblockAPI.getPlayer(name);

Creating a SuperiorPlayer

You can create a SuperiorPlayer object using the Builder pattern:
SuperiorPlayer player = SuperiorPlayer.newBuilder()
    .setUniqueId(uuid)
    .setName("PlayerName")
    .setPlayerRole(PlayerRole.defaultRole())
    .setDisbands(3)
    .setLocale(Locale.ENGLISH)
    .build();

General Methods

getUniqueId
UUID
Get the UUID of the player.
UUID uuid = superiorPlayer.getUniqueId();
getName
String
Get the last known name of the player.
String name = superiorPlayer.getName();
getCache
PlayerCache
Get the player’s cache for storing temporary data. The cache is not persistent between server sessions.
PlayerCache cache = superiorPlayer.getCache();
getTextureValue
String
Get the last known skin-texture value of the player.
String texture = superiorPlayer.getTextureValue();
setTextureValue
void
Set the skin-texture value for the player.
superiorPlayer.setTextureValue(textureValue);
textureValue
String
required
The skin texture value to set
updateLastTimeStatus
void
Update the last time the player joined or left the server to the current time.
superiorPlayer.updateLastTimeStatus();
setLastTimeStatus
void
Set the last time the player joined or left the server.
superiorPlayer.setLastTimeStatus(System.currentTimeMillis());
lastTimeStatus
long
required
The time in milliseconds to set
getLastTimeStatus
long
Get the last time the player joined or left the server.
long lastTime = superiorPlayer.getLastTimeStatus();
updateName
void
Update the cached name with the current player’s name. When the player is offline, nothing will happen.
superiorPlayer.updateName();
setName
void
Set the cached name. When the player joins the server, it will be synced with their correct name.
superiorPlayer.setName("NewName");
name
String
required
The name to set
asPlayer
Player
Get the Bukkit Player object. Returns null if the player is offline.
Player player = superiorPlayer.asPlayer();
if (player != null) {
    // Player is online
}
asOfflinePlayer
OfflinePlayer
Get the Bukkit OfflinePlayer object. Can return null for invalid players (e.g., NPCs).
OfflinePlayer offlinePlayer = superiorPlayer.asOfflinePlayer();
isOnline
boolean
Check whether the player is currently online.
if (superiorPlayer.isOnline()) {
    // Player is online
}
runIfOnline
void
Execute code only if the player is online.
superiorPlayer.runIfOnline(player -> {
    player.sendMessage("You are online!");
});
toRun
Consumer<Player>
required
Consumer to execute with the online player
hasFlyGamemode
boolean
Check whether the player is in a gamemode with fly mode enabled. Returns false when the player is offline.
boolean canFly = superiorPlayer.hasFlyGamemode();
getOpenedView
MenuView<?, ?>
Get the currently opened menu view for the player. Returns null when the player is offline or no view is opened.
MenuView<?, ?> view = superiorPlayer.getOpenedView();
isAFK
boolean
Check whether the player is AFK. Returns false when the player is offline.
boolean afk = superiorPlayer.isAFK();
isVanished
boolean
Check whether the player is vanished. Returns false when the player is offline.
boolean vanished = superiorPlayer.isVanished();
isShownAsOnline
boolean
Check whether the player is shown as online. Returns false if vanished, in spectator mode, or offline.
boolean shownAsOnline = superiorPlayer.isShownAsOnline();

Permission Methods

hasPermission
boolean
Check whether the player has a permission. Returns false when the player is offline.
// Check server permission
boolean hasPerm = superiorPlayer.hasPermission("some.permission");

// Check island privilege
boolean hasPrivilege = superiorPlayer.hasPermission(IslandPrivilege.FLY);
permission
String | IslandPrivilege
required
The permission to check - either a String for server permissions or IslandPrivilege for island permissions
hasPermissionWithoutOP
boolean
Check whether the player has a permission without having OP status.
boolean hasPerm = superiorPlayer.hasPermissionWithoutOP("some.permission");
permission
String
required
The permission to check
hasBypassPermission
boolean
Check whether the player has the bypass permission for an IslandPrivilege.
boolean canBypass = superiorPlayer.hasBypassPermission(IslandPrivilege.BREAK);
permission
IslandPrivilege
required
The island privilege to check bypass permission for
canHit
HitActionResult
Check whether this player can hit another player. Takes into account PvP settings, warm-up, and various protection rules.Players cannot hit each other if:
  • They are inside an island that has PvP disabled
  • One of them has PvP warm-up active
  • They are both in the same island and hitting outside a PvP world
  • One of the players isn’t online
  • The target is a visitor or coop who can’t take damage
HitActionResult result = superiorPlayer.canHit(otherPlayer);
if (result == HitActionResult.SUCCESS) {
    // Can hit the other player
}
otherPlayer
SuperiorPlayer
required
The other player to check

Location Methods

getWorld
World
Get the world the player is currently in. Returns null when the player is offline.
World world = superiorPlayer.getWorld();
getLocation
Location
Get the current location of the player. Returns null when the player is offline.
// Get new Location object
Location loc = superiorPlayer.getLocation();

// Reuse existing Location object
Location reusedLoc = new Location(null, 0, 0, 0);
superiorPlayer.getLocation(reusedLoc);
location
Location
Location object to reuse (optional)
teleport
void
Teleport the player to a location or island.
// Teleport to a location
superiorPlayer.teleport(location);

// Teleport with callback
superiorPlayer.teleport(location, success -> {
    if (success) {
        // Teleport successful
    }
});

// Teleport to an island
superiorPlayer.teleport(island);

// Teleport to specific dimension
superiorPlayer.teleport(island, Dimension.NORMAL);

// Teleport to island with callback
superiorPlayer.teleport(island, Dimension.NETHER, success -> {
    if (success) {
        // Teleport successful
    }
});
location
Location
The location to teleport to
island
Island
The island to teleport to
dimension
Dimension
The dimension to teleport to (NORMAL, NETHER, THE_END)
teleportResult
Consumer<Boolean>
Consumer called when teleportation completes with success status
isInsideIsland
boolean
Check whether the player is currently inside their island. Returns false when offline or without an island.
boolean inside = superiorPlayer.isInsideIsland();

Island Methods

getIslandLeader
SuperiorPlayer
Get the island owner of the player’s island.
SuperiorPlayer leader = superiorPlayer.getIslandLeader();
getIsland
Island
Get the island the player is a member of. Returns null if the player doesn’t have an island.
Island island = superiorPlayer.getIsland();
if (island != null) {
    // Player has an island
}
setIsland
void
Set the island of the player. Can cause issues if not used properly!
superiorPlayer.setIsland(island);
island
Island
required
The island to set - must contain the player as a member
This method should be used carefully. The island must already contain the player as a member, or an IllegalArgumentException will be thrown.
hasIsland
boolean
Check if this player is a member of an island.
if (superiorPlayer.hasIsland()) {
    // Player is in an island
}

Island Invitations

addInvite
void
Add an invitation to an island for the player. Do not call this method directly unless you know what you’re doing. Instead, use Island.inviteMember(SuperiorPlayer).
island
Island
required
The island that invited the player
removeInvite
void
Remove an invitation from an island for the player. Do not call this method directly unless you know what you’re doing. Instead, use Island.revokeInvite(SuperiorPlayer).
island
Island
required
The island to remove the invitation from
getInvites
List<Island>
Get all pending invites for the player, in the same order they were sent.
List<Island> invites = superiorPlayer.getInvites();
for (Island invite : invites) {
    // Process each invite
}

Coop Islands

addCoop
void
Mark player as a coop member of an island. Can cause issues if not used properly!
island
Island
required
The island to mark the player as coop - must contain player as a coop member
The island must already contain the player as a coop, or an IllegalArgumentException will be thrown.
removeCoop
void
Remove mark of the player as a coop of an island. Can cause issues if not used properly!
island
Island
required
The island to remove the coop mark from
getCoopIslands
List<Island>
Get all islands that the player is coop of.
List<Island> coopIslands = superiorPlayer.getCoopIslands();

Player Role

getPlayerRole
PlayerRole
Get the role of the player on their island.
PlayerRole role = superiorPlayer.getPlayerRole();
setPlayerRole
void
Set the role of the player on their island.
superiorPlayer.setPlayerRole(PlayerRole.of("admin"));
playerRole
PlayerRole
required
The role to give the player

Disbands

getDisbands
int
Get the amount of disbands remaining for the player.
int disbands = superiorPlayer.getDisbands();
setDisbands
void
Set the amount of disbands for the player.
superiorPlayer.setDisbands(3);
disbands
int
required
The number of disbands to set
hasDisbands
boolean
Check whether the player has any disbands remaining.
if (superiorPlayer.hasDisbands()) {
    // Can disband island
}

Preferences Methods

getUserLocale
Locale
Get the locale of the player.
Locale locale = superiorPlayer.getUserLocale();
setUserLocale
void
Set the locale of the player.
superiorPlayer.setUserLocale(Locale.FRENCH);
locale
Locale
required
The locale to set

World Border

hasWorldBorderEnabled
boolean
Check whether the world border is enabled for the player.
boolean enabled = superiorPlayer.hasWorldBorderEnabled();
toggleWorldBorder
void
Toggle the world border for the player.
superiorPlayer.toggleWorldBorder();
setWorldBorderEnabled
void
Set whether the world border is enabled for the player.
superiorPlayer.setWorldBorderEnabled(true);
enabled
boolean
required
true to enable borders, false to disable
updateWorldBorder
void
Update the world border for this player.
superiorPlayer.updateWorldBorder(island);
island
Island
The island the player should see the border of (can be null)

Blocks Stacker

hasBlocksStackerEnabled
boolean
Check whether blocks-stacker mode is enabled for the player.
boolean enabled = superiorPlayer.hasBlocksStackerEnabled();
toggleBlocksStacker
void
Toggle the blocks-stacker mode for the player.
superiorPlayer.toggleBlocksStacker();
setBlocksStacker
void
Set whether blocks-stacker mode is enabled for the player.
superiorPlayer.setBlocksStacker(true);
enabled
boolean
required
true to enable blocks-stacker mode

Schematic Mode

hasSchematicModeEnabled
boolean
Check whether schematic mode is enabled for the player.
boolean enabled = superiorPlayer.hasSchematicModeEnabled();
toggleSchematicMode
void
Toggle the schematic mode for the player.
superiorPlayer.toggleSchematicMode();
setSchematicMode
void
Set whether schematic mode is enabled for the player.
superiorPlayer.setSchematicMode(true);
enabled
boolean
required
true to enable schematic mode

Team Chat

hasTeamChatEnabled
boolean
Check whether team chat is enabled for the player.
boolean enabled = superiorPlayer.hasTeamChatEnabled();
toggleTeamChat
void
Toggle the team chat for the player.
superiorPlayer.toggleTeamChat();
setTeamChat
void
Set whether team chat is enabled for the player.
superiorPlayer.setTeamChat(true);
enabled
boolean
required
true to enable team chat

Bypass Mode

hasBypassModeEnabled
boolean
Check whether bypass mode is enabled for the player.
boolean enabled = superiorPlayer.hasBypassModeEnabled();
toggleBypassMode
void
Toggle the bypass mode for the player.
superiorPlayer.toggleBypassMode();
setBypassMode
void
Set whether bypass mode is enabled for the player.
superiorPlayer.setBypassMode(true);
enabled
boolean
required
true to enable bypass mode

Panel & UI

hasToggledPanel
boolean
Check whether the player has their panel toggled.
boolean toggled = superiorPlayer.hasToggledPanel();
setToggledPanel
void
Set whether the player has their panel toggled.
superiorPlayer.setToggledPanel(true);
toggledPanel
boolean
required
true to toggle panel on

Island Fly

hasIslandFlyEnabled
boolean
Check whether the player has island flying enabled.
boolean enabled = superiorPlayer.hasIslandFlyEnabled();
toggleIslandFly
void
Toggle flying mode for the player.
superiorPlayer.toggleIslandFly();
setIslandFly
void
Set whether the player has flying enabled.
superiorPlayer.setIslandFly(true);
enabled
boolean
required
true to enable flying

Admin Spy

hasAdminSpyEnabled
boolean
Check whether the player has admin spy mode enabled.
boolean enabled = superiorPlayer.hasAdminSpyEnabled();
toggleAdminSpy
void
Toggle admin spy mode for the player.
superiorPlayer.toggleAdminSpy();
setAdminSpy
void
Set whether the player has admin spy mode enabled.
superiorPlayer.setAdminSpy(true);
enabled
boolean
required
true to enable admin spy mode

Border Color

getBorderColor
BorderColor
Get the border color preference of the player.
BorderColor color = superiorPlayer.getBorderColor();
setBorderColor
void
Set the border color for the player.
superiorPlayer.setBorderColor(BorderColor.BLUE);
borderColor
BorderColor
required
The border color to set

Schematic Methods

getSchematicPos1
BlockPosition
Get the first schematic position of the player. May be null.
BlockPosition pos1 = superiorPlayer.getSchematicPos1();
setSchematicPos1
void
Set the first schematic position of the player.
Block block = ...;
superiorPlayer.setSchematicPos1(block);
block
Block
The block to change the position to (can be null)
getSchematicPos2
BlockPosition
Get the second schematic position of the player. May be null.
BlockPosition pos2 = superiorPlayer.getSchematicPos2();
setSchematicPos2
void
Set the second schematic position of the player.
Block block = ...;
superiorPlayer.setSchematicPos2(block);
block
Block
The block to change the position to (can be null)

Player Status

setPlayerStatus
void
Set a status flag for the player.
superiorPlayer.setPlayerStatus(PlayerStatus.PVP_IMMUNED);
playerStatus
PlayerStatus
required
The status to set
removePlayerStatus
void
Remove a status flag from the player.
superiorPlayer.removePlayerStatus(PlayerStatus.PVP_IMMUNED);
playerStatus
PlayerStatus
required
The status to remove
hasPlayerStatus
boolean
Check if the player has a specific status.
if (superiorPlayer.hasPlayerStatus(PlayerStatus.PVP_IMMUNED)) {
    // Player is immune to PvP
}
playerStatus
PlayerStatus
required
The status to check

Available Player Statuses

  • PVP_IMMUNED - The player is immune to PvP and cannot be damaged by other players
  • PORTALS_IMMUNED - The player cannot be teleported by portals
  • FALL_DAMAGE_IMMUNED - The player cannot take fall damage
  • LEAVING_ISLAND - The player recently left an island
  • VOID_TELEPORT - The player is being teleported by void-teleport

Teleport Task

getTeleportTask
BukkitTask
Get the current active teleport task of the player. Returns null if no teleport is in progress.
BukkitTask task = superiorPlayer.getTeleportTask();
if (task != null) {
    // Teleport in progress
}
setTeleportTask
void
Set a teleportation task for the player. Used for warmups and delayed teleports.
BukkitTask task = ...;
superiorPlayer.setTeleportTask(task);
teleportTask
BukkitTask
The teleport task to set (can be null to clear)

Utility Methods

merge
void
Merge another player’s data into this player object.
superiorPlayer.merge(otherPlayer);
otherPlayer
SuperiorPlayer
required
The player to merge data from

Builder Interface

The SuperiorPlayer.Builder interface allows you to create player objects with predefined values.
SuperiorPlayer.Builder builder = SuperiorPlayer.newBuilder();

Builder Methods

setUniqueId
Builder
Set the UUID for the player. Required before calling build().
uuid
UUID
required
The player’s UUID
setName
Builder
Set the player’s name.
name
String
required
The player’s name
setPlayerRole
Builder
Set the player’s role.
playerRole
PlayerRole
required
The role to assign
setDisbands
Builder
Set the number of disbands.
disbands
int
required
The disband count
setLocale
Builder
Set the player’s locale.
locale
Locale
required
The locale to set
setTextureValue
Builder
Set the player’s skin texture value.
textureValue
String
required
The texture value
setLastTimeUpdated
Builder
Set the last time the player was updated.
lastTimeUpdated
long
required
The time in milliseconds
setToggledPanel
Builder
Set whether the panel is toggled.
toggledPanel
boolean
required
Panel toggle state
setIslandFly
Builder
Set whether island fly is enabled.
islandFly
boolean
required
Island fly state
setBorderColor
Builder
Set the border color.
borderColor
BorderColor
required
The border color
setWorldBorderEnabled
Builder
Set whether world border is enabled.
worldBorderEnabled
boolean
required
World border state
setCompletedMission
Builder
Set a completed mission with its finish count.
mission
Mission<?>
required
The mission
finishCount
int
required
Number of times completed
setPersistentData
Builder
Set persistent data for the player.
persistentData
byte[]
required
The persistent data
build
SuperiorPlayer
Build and create the SuperiorPlayer object. The UUID must be set before calling this method.
SuperiorPlayer player = builder
    .setUniqueId(uuid)
    .setName("PlayerName")
    .build();
  • PlayerCache - /home/daytona/workspace/source/API/src/main/java/com/bgsoftware/superiorskyblock/api/player/cache/PlayerCache.java:1
  • PlayerRole - See PlayerRole System
  • PlayerStatus - /home/daytona/workspace/source/API/src/main/java/com/bgsoftware/superiorskyblock/api/player/PlayerStatus.java:1
  • BlockPosition - /home/daytona/workspace/source/API/src/main/java/com/bgsoftware/superiorskyblock/api/wrappers/BlockPosition.java:1

Build docs developers (and LLMs) love