UserRepository interface
Every player Venus is currently tracking, addressable by UUID, entity id or name.
Reach it through api.users(). Venus builds a user object when a player joins and drops it when they quit, so the repository only ever contains online players — an empty answer almost always means "offline", not "broken".
| Signature | Description |
|---|---|
Optional<User> queryUserByUuid(UUID uuid) | The canonical lookup. Same UUID whether or not the player has spawned yet. |
Optional<User> queryUserByEntityId(int entityId) | For packet work where you only have the network entity id. |
Optional<User> queryUserByName(String name) | Case-insensitive exact name match. No partial or prefix search. |
int size() | How many users Venus is tracking right now. |
VenusAPIProvider.getAsync().thenAccept(api ->
Bukkit.getOnlinePlayers().forEach(player -> {
api.users().queryUserByUuid(player.getUniqueId()).ifPresent(user -> {
// user is a Venus User, not a Bukkit Player
getLogger().info(user.username() + " ping=" + user.getTransactionPing());
});
}));Names go stale
Names change; UUIDs do not. Cache the UUID when you see it and resolve through queryUserByUuid afterwards. queryUserByName exists for command plumbing, where the sender typed a name and you have nothing else.
What "tracked" means
- A player is tracked from the moment Venus finishes processing their join — there is a short window on login where the lookup still returns empty.
- Exempted players are still tracked; exemption stops checks, not bookkeeping. Use ExemptionService to ask whether checks are actually running for them.
- The repository is per-server. Players on other servers of a network are not visible.
Next: the User interface itself.