PolarDocs Client Area

User Interface

Introduction#

The User interface represents a player in Polar and provides methods to access player information and perform player-related actions.

Every method may throw ObjectAccessException if the underlying player object is no longer accessible; see Exceptions.

Methods#

username#

java
String username();

Description:

Gets the username of the player.

Returns:

The player's username as a String.

profile#

java
String profile();

Description:

Generates a string with the player's details, according to the template configured in Polar.

Returns:

The player's profile as a String.

entityId#

java
int entityId();

Description:

Gets the entity ID of the player.

Returns:

The player's entity ID as an int.

ticksExisted#

java
int ticksExisted();

Description:

Gets the number of ticks the player has existed in the server.

Returns:

The number of ticks as an int.

sensitivity#

java
@Nullable
Double sensitivity();

Description:

Gets the player's configured mouse input sensitivity, as estimated by Polar.

Returns:

A number generally between 0 and 200, or null if the sensitivity is not yet known.

bedrock#

java
boolean bedrock();

Description:

Determines if the player is using a Bedrock client.

Returns:

true if the player is using a Bedrock client, false otherwise.

uuid#

java
UUID uuid();

Description:

Gets the unique identifier of the player.

Returns:

The player's UUID.

clientVersion#

java
ClientVersion clientVersion();

Description:

Gets information about the player's client version.

Returns:

A ClientVersion object containing details about the player's client.

connection#

java
PlayerConnection connection();

Description:

Gets information about the player's connection.

Returns:

A PlayerConnection object containing details about the player's connection.

configOverride#

java
ConfigOverride configOverride();

Description:

Accesses per-player overrides of the global Polar configuration.

Returns:

The ConfigOverride options for the player.

bukkitPlayer#

java
Optional<Player> bukkitPlayer();

Description:

Gets the associated Bukkit player instance, if available.

Returns:

An Optional containing the Bukkit Player object, or an empty Optional if not available.

exempt#

java
void exempt();

Description:

Exempts the player from the anticheat entirely.

This action is irreversible and destroys the user object. Any further call on this User will throw ObjectAccessException. The exemption is removed when the player disconnects.

For a reversible exemption from cloud checks only, see exemptFromCloud.

Getter exemptFromCloud#

java
boolean exemptFromCloud();

Description:

Determines if the player is exempt from cloud checks and punishments.

Returns:

true if the player is exempt from cloud checks and punishments, false otherwise.

Setter exemptFromCloud#

java
void exemptFromCloud(boolean exemptFromCloud);

Description:

Exempts the player from cloud checks and punishments, or removes such an exemption. Unlike exempt(), this is reversible and keeps the user object intact.

Upon setting this back to false, any queued punishments for this player will be cleared.

Parameters:

  • exemptFromCloud - true to exempt the player from cloud checks and punishments, false to re-enable them.

Returns:

Nothing.

kick#

java
boolean kick(String reason);

Description:

Kicks the player from the server with the specified reason. This is an ordinary safety kick, not a punishment; it fires an OrdinaryKickEvent with apiInitiated set to true.

Parameters:

  • reason - The reason for kicking the player.

Returns:

true if the kick was successful, false otherwise.

issueKickPunishment#

java
boolean issueKickPunishment(String reason);

Description:

Issues a kick punishment to the player with the specified reason, running the configured kick commands.

Parameters:

  • reason - The reason for the punishment.

Returns:

true if the punishment was successful, false otherwise.

issueBanPunishment#

java
boolean issueBanPunishment(String reason);

Description:

Issues a ban punishment to the player with the specified reason, running the configured ban commands.

Parameters:

  • reason - The reason for the punishment.

Returns:

true if the punishment was successful, false otherwise.

detectionAlertSettings#

java
AlertSettings detectionAlertSettings();

Description:

Gets the alert settings for detections related to this player.

Returns:

The player's detection AlertSettings.

mitigationAlertSettings#

java
AlertSettings mitigationAlertSettings();

Description:

Gets the alert settings for mitigations related to this player.

Returns:

The player's mitigation AlertSettings.