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
Creating a SuperiorPlayer
You can create aSuperiorPlayer object using the Builder pattern:
General Methods
Get the UUID of the player.
Get the last known name of the player.
Get the player’s cache for storing temporary data. The cache is not persistent between server sessions.
Get the last known skin-texture value of the player.
Update the last time the player joined or left the server to the current time.
Set the last time the player joined or left the server.
The time in milliseconds to set
Get the last time the player joined or left the server.
Update the cached name with the current player’s name. When the player is offline, nothing will happen.
Set the cached name. When the player joins the server, it will be synced with their correct name.
The name to set
Get the Bukkit Player object. Returns
null if the player is offline.Get the Bukkit OfflinePlayer object. Can return
null for invalid players (e.g., NPCs).Check whether the player is currently online.
Execute code only if the player is online.
Consumer to execute with the online player
Check whether the player is in a gamemode with fly mode enabled. Returns
false when the player is offline.Get the currently opened menu view for the player. Returns
null when the player is offline or no view is opened.Check whether the player is AFK. Returns
false when the player is offline.Check whether the player is vanished. Returns
false when the player is offline.Check whether the player is shown as online. Returns
false if vanished, in spectator mode, or offline.Permission Methods
Check whether the player has a permission. Returns
false when the player is offline.The permission to check - either a String for server permissions or IslandPrivilege for island permissions
Check whether the player has a permission without having OP status.
The permission to check
Check whether the player has the bypass permission for an IslandPrivilege.
The island privilege to check bypass permission for
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
The other player to check
Location Methods
Get the world the player is currently in. Returns
null when the player is offline.Get the current location of the player. Returns
null when the player is offline.Location object to reuse (optional)
Check whether the player is currently inside their island. Returns
false when offline or without an island.Island Methods
Get the island owner of the player’s island.
Get the island the player is a member of. Returns
null if the player doesn’t have an island.Set the island of the player. Can cause issues if not used properly!
The island to set - must contain the player as a member
Check if this player is a member of an island.
Island Invitations
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).The island that invited the player
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).The island to remove the invitation from
Get all pending invites for the player, in the same order they were sent.
Coop Islands
Mark player as a coop member of an island. Can cause issues if not used properly!
The island to mark the player as coop - must contain player as a coop member
Remove mark of the player as a coop of an island. Can cause issues if not used properly!
The island to remove the coop mark from
Get all islands that the player is coop of.
Player Role
Get the role of the player on their island.
Disbands
Get the amount of disbands remaining for the player.
Check whether the player has any disbands remaining.
Preferences Methods
Get the locale of the player.
World Border
Check whether the world border is enabled for the player.
Toggle the world border for the player.
Set whether the world border is enabled for the player.
true to enable borders, false to disable
Update the world border for this player.
The island the player should see the border of (can be null)
Blocks Stacker
Check whether blocks-stacker mode is enabled for the player.
Toggle the blocks-stacker mode for the player.
Set whether blocks-stacker mode is enabled for the player.
true to enable blocks-stacker mode
Schematic Mode
Check whether schematic mode is enabled for the player.
Toggle the schematic mode for the player.
Set whether schematic mode is enabled for the player.
true to enable schematic mode
Team Chat
Check whether team chat is enabled for the player.
Toggle the team chat for the player.
Bypass Mode
Check whether bypass mode is enabled for the player.
Toggle the bypass mode for the player.
Panel & UI
Check whether the player has their panel toggled.
Island Fly
Check whether the player has island flying enabled.
Toggle flying mode for the player.
Admin Spy
Check whether the player has admin spy mode enabled.
Toggle admin spy mode for the player.
Set whether the player has admin spy mode enabled.
true to enable admin spy mode
Border Color
Get the border color preference of the player.
Schematic Methods
Get the first schematic position of the player. May be
null.Set the first schematic position of the player.
The block to change the position to (can be null)
Get the second schematic position of the player. May be
null.Set the second schematic position of the player.
The block to change the position to (can be null)
Player Status
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
Get the current active teleport task of the player. Returns
null if no teleport is in progress.Set a teleportation task for the player. Used for warmups and delayed teleports.
The teleport task to set (can be null to clear)
Utility Methods
Merge another player’s data into this player object.
The player to merge data from
Builder Interface
TheSuperiorPlayer.Builder interface allows you to create player objects with predefined values.
Builder Methods
Set the UUID for the player. Required before calling
build().The player’s UUID
Set the player’s skin texture value.
The texture value
Set the last time the player was updated.
The time in milliseconds
Set whether the panel is toggled.
Panel toggle state
Set whether world border is enabled.
World border state
Set persistent data for the player.
The persistent data
Build and create the SuperiorPlayer object. The UUID must be set before calling this method.
Related Interfaces
- 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