public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable
Modifier and Type | Method and Description |
---|---|
default BanEntry |
banPlayer(String reason)
Permanently Bans this player from the server
|
default BanEntry |
banPlayer(String reason,
Date expires)
Bans this player from the server
|
default BanEntry |
banPlayer(String reason,
Date expires,
String source)
Bans this player from the server
|
default BanEntry |
banPlayer(String reason,
Date expires,
String source,
boolean kickIfOnline) |
default BanEntry |
banPlayer(String reason,
String source)
Permanently Bans this player from the server
|
Location |
getBedSpawnLocation()
Gets the Location where the player will spawn at their bed, null if
they have not slept in one or their current bed spawn is invalid.
|
long |
getFirstPlayed()
Gets the first date and time that this player was witnessed on this
server.
|
long |
getLastLogin()
Gets the last date and time that this player logged into the server.
|
long |
getLastPlayed()
Deprecated.
The API contract is ambiguous and the implementation may or may not return the correct value given this API ambiguity. It is instead recommended use
getLastLogin() or getLastSeen() depending on your needs. |
long |
getLastSeen()
Gets the last date and time that this player was seen on the server.
|
String |
getName()
Returns the name of this player
|
Player |
getPlayer()
Gets a
Player object that this represents, if there is one |
UUID |
getUniqueId()
Returns the UUID of this player
|
boolean |
hasPlayedBefore()
Checks if this player has played on this server before.
|
boolean |
isBanned()
Checks if this player is banned or not
|
boolean |
isOnline()
Checks if this player is currently online
|
boolean |
isWhitelisted()
Checks if this player is whitelisted or not
|
void |
setWhitelisted(boolean value)
Sets if this player is whitelisted or not
|
isOp, setOp
serialize
boolean isOnline()
@Nullable String getName()
Names are no longer unique past a single game session. For persistent storage
it is recommended that you use getUniqueId()
instead.
getName
in interface AnimalTamer
@NotNull UUID getUniqueId()
getUniqueId
in interface AnimalTamer
boolean isBanned()
@NotNull default BanEntry banPlayer(@Nullable String reason)
reason
- Reason for Ban@NotNull default BanEntry banPlayer(@Nullable String reason, @Nullable String source)
reason
- Reason for Bansource
- Source of the ban, or null for default@NotNull default BanEntry banPlayer(@Nullable String reason, @Nullable Date expires)
reason
- Reason for Banexpires
- When to expire the ban@NotNull default BanEntry banPlayer(@Nullable String reason, @Nullable Date expires, @Nullable String source)
reason
- Reason for Banexpires
- When to expire the bansource
- Source of the ban or null for default@NotNull default BanEntry banPlayer(@Nullable String reason, @Nullable Date expires, @Nullable String source, boolean kickIfOnline)
boolean isWhitelisted()
void setWhitelisted(boolean value)
value
- true if whitelisted@Nullable Player getPlayer()
Player
object that this represents, if there is one
If the player is online, this will return that player. Otherwise, it will return null.
long getFirstPlayed()
If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
@Deprecated long getLastPlayed()
getLastLogin()
or getLastSeen()
depending on your needs.If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
boolean hasPlayedBefore()
@Nullable Location getBedSpawnLocation()
long getLastLogin()
If the player has never played before, this will return 0. Otherwise, it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
long getLastSeen()
If the player has never played before, this will return 0. If the player is currently online, this will return the current time. Otherwise it will be the amount of milliseconds since midnight, January 1, 1970 UTC.
Copyright © 2022. All rights reserved.