User interface
A player tracked by Venus: identity, latency, connection info, and the actions you can take on them.
Obtained from UserRepository lookups or from any user event. The interface has two halves: the low-level accessors Venus has always exposed (getName(), getTransactionPing(), …) and Polar-style shorthands (username(), connection(), …) implemented as default methods on top of them. Use whichever reads better; they answer from the same state.
Core state
| Signature | Description |
|---|---|
UUID getUniqueId() | The player UUID. |
String getName() | Current username. |
String getBrand() | Client brand, e.g. vanilla, lunarclient. |
int getTransactionPing() | Transaction-based ping in ms; the number alerts show. |
int getKeepAlivePing() | Keep-alive based ping in ms. |
String getVersionName() | Client version name, e.g. 1.21.4. |
double getHorizontalSensitivity() | Rotation sensitivity Venus measured for this player. |
double getVerticalSensitivity() | Vertical counterpart of the above. |
boolean isVanillaMath() | Whether the player appears to use vanilla movement maths. |
Collection<? extends AbstractCheck> getChecks() | Live check instances carrying this player’s violation state. |
String getWorldName() / UUID getWorldUID() | The world the player is in, when known. |
void sendMessage(String message) | Sends a MiniMessage-formatted line; %placeholder% variables are replaced. |
boolean hasPermission(String permission) | Permission check against the player’s current client state. |
Shorthands
| Signature | Description |
|---|---|
String username() | Alias of getName(). |
UUID uuid() | Alias of getUniqueId(). |
String profile() | Alias of getBrand(). |
int entityId() | Platform entity id, 0 when the implementation does not know it. |
boolean bedrock() | True when the brand looks like Bedrock (Geyser and friends). |
ClientVersion clientVersion() | protocolVersion, name and brand in one object. |
PlayerConnection connection() | latency(), latencyAverage() and latencyDeviation(). |
Double sensitivity() | Horizontal sensitivity, or null when unknown. |
ConfigOverride configOverride() | This session’s per-user overrides. |
Optional<Player> bukkitPlayer() | The Bukkit player, only on Bukkit servers while they are still online. |
Actions
user.kick("Invalid movement");
// vs
user.disconnect("Connection closed");The distinction matters. kick(reason) runs the punishment path, so a PunishmentEvent or OrdinaryKickEvent listener can cancel it. disconnect(reason) is the raw connection drop: nothing is fired, nothing can cancel it, and the reason reaches the player's screen as-is. Prefer kick unless you specifically need the uncancellable path. Both return false when the player is already gone.
| Signature | Description |
|---|---|
boolean kick(String reason) | Cancellable punishment kick. |
boolean disconnect(String reason) | Raw, uncancellable disconnect. |
boolean issueKickPunishment(String reason) | Explicitly the kick punishment; defaults to kick(). |
boolean issueBanPunishment(String reason) | Runs the configured ban action for this player. |
void exempt() | Stops Venus processing this user until they reconnect. |
boolean exemptFromCloud() / exemptFromCloud(boolean) | Cloud-only exemption; local checks keep running. |
void updatePermissions() | Re-reads permissions after you change them. |
AlertSettings detectionAlertSettings() | Per-channel alert state; AlertSettings.NONE when unset. |
Thread hops
// Runs on the player's netty thread — packet context, no Bukkit API:
user.runSafely(() -> user.addRealTimeTaskNext(() -> {
// fires when the client answers the next transaction
}));
// Hop to the main thread yourself when touching Bukkit objects:
Bukkit.getScheduler().runTask(plugin, () -> {
Player player = user.bukkitPlayer().orElse(null);
if (player != null) player.teleport(spawn);
});