Package org.bukkit
Interface OfflinePlayer
- All Superinterfaces:
AnimalTamer
,ConfigurationSerializable
,ServerOperator
- All Known Subinterfaces:
Player
public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable
-
Method Summary
Modifier and Type Method Description 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
getLastPlayed()
Gets the last date and time that this player was witnessed on this server.java.lang.String
getName()
Returns the name of this playerPlayer
getPlayer()
Gets aPlayer
object that this represents, if there is onejava.util.UUID
getUniqueId()
Returns the UUID of this playerboolean
hasPlayedBefore()
Checks if this player has played on this server before.boolean
isBanned()
Checks if this player is banned or notboolean
isOnline()
Checks if this player is currently onlineboolean
isWhitelisted()
Checks if this player is whitelisted or notvoid
setBanned(boolean banned)
Deprecated.UseBanList.addBan(String, String, Date, String)
orBanList.pardon(String)
to enhance functionalityvoid
setWhitelisted(boolean value)
Sets if this player is whitelisted or notMethods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
Method Details
-
isOnline
boolean isOnline()Checks if this player is currently online- Returns:
- true if they are online
-
getName
java.lang.String getName()Returns the name of this playerNames are no longer unique past a single game session. For persistent storage it is recommended that you use
getUniqueId()
instead.- Specified by:
getName
in interfaceAnimalTamer
- Returns:
- Player name or null if we have not seen a name for this player yet
-
getUniqueId
java.util.UUID getUniqueId()Returns the UUID of this player- Specified by:
getUniqueId
in interfaceAnimalTamer
- Returns:
- Player UUID
-
isBanned
boolean isBanned()Checks if this player is banned or not- Returns:
- true if banned, otherwise false
-
setBanned
@Deprecated void setBanned(boolean banned)Deprecated.UseBanList.addBan(String, String, Date, String)
orBanList.pardon(String)
to enhance functionalityBans or unbans this player- Parameters:
banned
- true if banned
-
isWhitelisted
boolean isWhitelisted()Checks if this player is whitelisted or not- Returns:
- true if whitelisted
-
setWhitelisted
void setWhitelisted(boolean value)Sets if this player is whitelisted or not- Parameters:
value
- true if whitelisted
-
getPlayer
Player getPlayer()Gets aPlayer
object that this represents, if there is oneIf the player is online, this will return that player. Otherwise, it will return null.
- Returns:
- Online player
-
getFirstPlayed
long getFirstPlayed()Gets the first date and time that this player was witnessed on this server.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.
- Returns:
- Date of first log-in for this player, or 0
-
getLastPlayed
long getLastPlayed()Gets the last date and time that this player was witnessed on this server.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.
- Returns:
- Date of last log-in for this player, or 0
-
hasPlayedBefore
boolean hasPlayedBefore()Checks if this player has played on this server before.- Returns:
- True if the player has played before, otherwise false
-
getBedSpawnLocation
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.- Returns:
- Bed Spawn Location if bed exists, otherwise null.
-