All Superinterfaces:
ArmorEquipable, Carrier, Contextual, DataHolder, DataHolder.Mutable, Equipable, Identifiable, Nameable, Subject, Tamer, ValueContainer

A User is the data usually associated with a Player that is persisted across server restarts. This is in contrast to Player which represents the in-game entity associated with an online User.
  • Method Details

    • profile

      GameProfile profile()
      Gets the associated GameProfile of this player.
      The user's profile
    • name

      String name()
      Gets the player's last known username.
      Specified by:
      name in interface Nameable
      The player's last known username
    • isOnline

      boolean isOnline()
      Checks if this user is online or not.
      True if the corresponding player is online
    • player

      Gets the related online player if the player is in fact online.
      The associated online player, if available
    • position

      Vector3d position()
      Gets the position of this User
      The position of this User
    • worldKey

      ResourceKey worldKey()
      Gets the world key of this User.
      The key, if found
    • setLocation

      boolean setLocation(ResourceKey world, Vector3d position)
      Sets the world and position of this User.

      The key must belong to an existing world.

      When the User isOnline() this redirects to Entity.setLocation(ServerLocation)

      position - The position to set
      world - The world key
      True if the location was accepted
    • setRotation

      void setRotation(Vector3d rotation)
      Sets the rotation of this entity.

      The format of the rotation is represented by:

      x -> pitch, y -> yaw, z -> roll

      rotation - The rotation to set the entity to
    • rotation

      Vector3d rotation()
      Gets the rotation.

      The format of the rotation is represented by:

      x -> pitch, y -> yaw, z -> roll

      The rotation
    • inventory

      CarriedInventory<? extends Carrier> inventory()
      Returns the inventory that this Carrier is holding. Note that this may be either a PlayerInventory or UserInventory, depending on whether the user is online or not.
      Specified by:
      inventory in interface Carrier
      The inventory this Carrier is holding
    • enderChestInventory

      Inventory enderChestInventory()
      Gets the Inventory available for this Player's shared EnderChest contents.
      The ender chest inventory
    • respawnLocations

      default MapValue.Mutable<ResourceKey,RespawnLocation> respawnLocations()
      The spawn locations of the user may have for various worlds
    • firstJoined

      default Optional<Value.Mutable<Instant>> firstJoined()
      The timestamp value when this user first joined
    • lastJoined

      default Optional<Value.Mutable<Instant>> lastJoined()
      The last timestamp value when this user has joined
    • invulnerable

      default Value.Mutable<Boolean> invulnerable()
      Whether the user is invulnerable
    • invisible

      default Value.Mutable<Boolean> invisible()
      Whether the user is invisible
    • vanishState

      default Value.Mutable<VanishState> vanishState()