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
Description:
Gets the username of the player.
Returns:
The player's username as a 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
Description:
Gets the entity ID of the player.
Returns:
The player's entity ID as an int.
ticksExisted
Description:
Gets the number of ticks the player has existed in the server.
Returns:
The number of ticks as an int.
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
Description:
Determines if the player is using a Bedrock client.
Returns:
true if the player is using a Bedrock client, false otherwise.
uuid
Description:
Gets the unique identifier of the player.
Returns:
The player's UUID.
clientVersion
Description:
Gets information about the player's client version.
Returns:
A ClientVersion object containing details about the player's client.
connection
Description:
Gets information about the player's connection.
Returns:
A PlayerConnection object containing details about the player's connection.
configOverride
Description:
Accesses per-player overrides of the global Polar configuration.
Returns:
The ConfigOverride options for the 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
Description:
Exempts the player from the anticheat entirely.
For a reversible exemption from cloud checks only, see exemptFromCloud.
Getter 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
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-trueto exempt the player from cloud checks and punishments,falseto re-enable them.
Returns:
Nothing.
kick
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
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
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
Description:
Gets the alert settings for detections related to this player.
Returns:
The player's detection AlertSettings.
mitigationAlertSettings
Description:
Gets the alert settings for mitigations related to this player.
Returns:
The player's mitigation AlertSettings.