Interface User
- All Superinterfaces:
ArmorEquipable, Carrier, Contextual, DataHolder, DataHolder.Mutable, Equipable, Identifiable, Nameable, Subject, Tamer, ValueContainer
@DoNotStore
public interface User
extends DataHolder.Mutable, ArmorEquipable, Tamer, Subject, Carrier
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface DataHolder
DataHolder.Immutable<I>, DataHolder.Mutable -
Method Summary
Modifier and TypeMethodDescriptionGets theInventoryavailable for this Player's sharedEnderChestcontents.default Optional<Value.Mutable<Instant>> default booleanCarriedInventory<? extends Carrier> Returns the inventory that this Carrier is holding.default Value.Mutable<Boolean> default Value.Mutable<Boolean> booleanisOnline()Checks if this user is online or not.default Optional<Value.Mutable<Instant>> name()Gets the player's last known username.player()Gets the related onlineplayerif the player is in fact online.position()Gets the position of this Userprofile()Gets the associatedGameProfileof this player.default MapValue.Mutable<ResourceKey, RespawnLocation> rotation()Gets the rotation.booleansetLocation(ResourceKey world, Vector3d position) Sets the world and position of this User.voidsetRotation(Vector3d rotation) Sets the rotation of this entity.default Value.Mutable<VanishState> worldKey()Gets the worldkeyof this User.Methods inherited from interface ArmorEquipable
chest, feet, head, itemInHand, itemInHand, legs, setChest, setFeet, setHead, setItemInHand, setItemInHand, setLegsMethods inherited from interface Contextual
friendlyIdentifier, identifierMethods inherited from interface DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undoMethods inherited from interface Equipable
canEquip, canEquip, canEquip, canEquip, equip, equip, equipment, equipped, equippedMethods inherited from interface Identifiable
uniqueIdMethods inherited from interface Subject
associatedObject, asSubjectReference, containingCollection, contextCause, hasPermission, hasPermission, hasPermission, isChildOf, isChildOf, isChildOf, isSubjectDataPersisted, option, option, option, parents, parents, parents, permissionValue, permissionValue, permissionValue, subjectData, transientSubjectDataMethods inherited from interface ValueContainer
get, getDouble, getInt, getKeys, getLong, getOrElse, getOrNull, getValue, getValues, require, requireValue, streamKeys, streamValues, supports, supports
-
Method Details
-
profile
-
name
-
isOnline
boolean isOnline()Checks if this user is online or not.- Returns:
- True if the corresponding player is online
-
player
Optional<ServerPlayer> player()Gets the related onlineplayerif the player is in fact online.- Returns:
- The associated online player, if available
-
position
-
worldKey
-
setLocation
Sets the world and position of this User.The
keymust belong to an existing world.When the User
isOnline()this redirects toEntity.setLocation(ServerLocation)- Parameters:
world- The world keyposition- The position to set- Returns:
- True if the location was accepted
-
setRotation
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
-
inventory
CarriedInventory<? extends Carrier> inventory()Returns the inventory that this Carrier is holding. Note that this may be either aPlayerInventoryorUserInventory, depending on whether the user is online or not. -
enderChestInventory
Inventory enderChestInventory()Gets theInventoryavailable for this Player's sharedEnderChestcontents.- Returns:
- The ender chest inventory
-
respawnLocations
- Returns:
- The spawn locations of the user may have for various worlds
-
firstJoined
- Returns:
- The timestamp value when this user first joined
-
lastJoined
- Returns:
- The last timestamp value when this user has joined
-
invulnerable
- Returns:
- Whether the user is invulnerable
-
invisible
-
vanishState
-
hasPlayedBefore
-