Interface User

    • Method Detail

      • name

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

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

        java.util.Optional<ServerPlayer> player()
        Gets the related online player if the player is in fact online.
        Returns:
        The associated online player, if available
      • position

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

        ResourceKey worldKey()
        Gets the world key of this User.
        Returns:
        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)

        Parameters:
        position - The position to set
        world - The world key
        Returns:
        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

        Parameters:
        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

        Returns:
        The rotation
      • enderChestInventory

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

        default java.util.Optional<Value.Mutable<java.time.Instant>> lastJoined()
        Returns:
        The last timestamp value when this user has joined
      • vanish

        @Deprecated
        default Value.Mutable<java.lang.Boolean> vanish()
        Deprecated.
        Returns:
        Whether the user is vanished
      • vanishIgnoresCollision

        @Deprecated
        default Value.Mutable<java.lang.Boolean> vanishIgnoresCollision()
        Deprecated.
        Returns:
        Whether the user ignores collision with other entities
      • vanishPreventsTargeting

        @Deprecated
        default Value.Mutable<java.lang.Boolean> vanishPreventsTargeting()
        Deprecated.
        Returns:
        Whether the user can be targeted for attack by another entity