Package net.luckperms.api.model.user
Interface User
-
- All Superinterfaces:
PermissionHolder
public interface User extends PermissionHolder
A player which holds permission data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.luckperms.api.model.PermissionHolder
PermissionHolder.Identifier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NonNull StringgetPrimaryGroup()Gets the users current primary group.@NonNull UUIDgetUniqueId()Gets the users unique ID@Nullable StringgetUsername()Gets the users username@NonNull DataMutateResultsetPrimaryGroup(@NonNull String group)Sets a users primary group.-
Methods inherited from interface net.luckperms.api.model.PermissionHolder
auditTemporaryNodes, data, getCachedData, getData, getDistinctNodes, getFriendlyName, getIdentifier, getInheritedGroups, getNodes, getNodes, getQueryOptions, resolveDistinctInheritedNodes, resolveInheritedNodes, resolveInheritedNodes, transientData
-
-
-
-
Method Detail
-
getUniqueId
@NonNull UUID getUniqueId()
Gets the users unique ID- Returns:
- the users Mojang assigned unique id
-
getUsername
@Nullable String getUsername()
Gets the users usernameReturns null if no username is known for the user.
- Returns:
- the users username
-
getPrimaryGroup
@NonNull String getPrimaryGroup()
Gets the users current primary group.The result of this method depends on which method is configured for primary group calculation. It may not be the same as any value set through
setPrimaryGroup(String).- Returns:
- the users primary group
-
setPrimaryGroup
@NonNull DataMutateResult setPrimaryGroup(@NonNull String group)
Sets a users primary group.This modifies the "stored value" for the users primary group, which may or may not actually take effect, depending on how the platform is calculating primary groups.
- Parameters:
group- the new primary group- Returns:
- if the change was applied successfully
- Throws:
IllegalStateException- if the user is not a member of that groupNullPointerException- if the group is null
-
-