Polar Help

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

String username();

Description:

Gets the username of the player.

Returns:

The player's username as a String.

profile

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

int entityId();

Description:

Gets the entity ID of the player.

Returns:

The player's entity ID as an int.

ticksExisted

int ticksExisted();

Description:

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

Returns:

The number of ticks as an int.

sensitivity

@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

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

UUID uuid();

Description:

Gets the unique identifier of the player.

Returns:

The player's UUID.

clientVersion

ClientVersion clientVersion();

Description:

Gets information about the player's client version.

Returns:

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

connection

PlayerConnection connection();

Description:

Gets information about the player's connection.

Returns:

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

configOverride

ConfigOverride configOverride();

Description:

Accesses per-player overrides of the global Polar configuration.

Returns:

The ConfigOverride options for the player.

bukkitPlayer

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

void exempt();

Description:

Exempts the player from the anticheat entirely.

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

Getter exemptFromCloud

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

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

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

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

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

AlertSettings detectionAlertSettings();

Description:

Gets the alert settings for detections related to this player.

Returns:

The player's detection AlertSettings.

mitigationAlertSettings

AlertSettings mitigationAlertSettings();

Description:

Gets the alert settings for mitigations related to this player.

Returns:

The player's mitigation AlertSettings.