Interface User

All Superinterfaces:
PermissionHolder

public interface User extends PermissionHolder
A player which holds permission data.
  • Method Details

    • getUniqueId

      @NonNull UUID getUniqueId()
      Gets the users unique ID
      Returns:
      the users Mojang assigned unique id
    • getUsername

      @Nullable String getUsername()
      Gets the users username

      Returns 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 group
      NullPointerException - if the group is null