Interface OfflinePlayer
- All Superinterfaces:
- AnimalTamer,- ConfigurationSerializable,- ServerOperator
- All Known Subinterfaces:
- Player
public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable
- 
Method SummaryModifier and Type Method Description voiddecrementStatistic(Statistic statistic)Decrements the given statistic for this player.voiddecrementStatistic(Statistic statistic, int amount)Decrements the given statistic for this player.voiddecrementStatistic(Statistic statistic, EntityType entityType)Decrements the given statistic for this player for the given entity.voiddecrementStatistic(Statistic statistic, EntityType entityType, int amount)Decrements the given statistic for this player for the given entity.voiddecrementStatistic(Statistic statistic, Material material)Decrements the given statistic for this player for the given material.voiddecrementStatistic(Statistic statistic, Material material, int amount)Decrements the given statistic for this player for the given material.LocationgetBedSpawnLocation()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.longgetFirstPlayed()Gets the first date and time that this player was witnessed on this server.longgetLastPlayed()Gets the last date and time that this player was witnessed on this server.StringgetName()Returns the name of this playerPlayergetPlayer()Gets aPlayerobject that this represents, if there is oneintgetStatistic(Statistic statistic)Gets the value of the given statistic for this player.intgetStatistic(Statistic statistic, EntityType entityType)Gets the value of the given statistic for this player.intgetStatistic(Statistic statistic, Material material)Gets the value of the given statistic for this player.UUIDgetUniqueId()Returns the UUID of this playerbooleanhasPlayedBefore()Checks if this player has played on this server before.voidincrementStatistic(Statistic statistic)Increments the given statistic for this player.voidincrementStatistic(Statistic statistic, int amount)Increments the given statistic for this player.voidincrementStatistic(Statistic statistic, EntityType entityType)Increments the given statistic for this player for the given entity.voidincrementStatistic(Statistic statistic, EntityType entityType, int amount)Increments the given statistic for this player for the given entity.voidincrementStatistic(Statistic statistic, Material material)Increments the given statistic for this player for the given material.voidincrementStatistic(Statistic statistic, Material material, int amount)Increments the given statistic for this player for the given material.booleanisBanned()Checks if this player is banned or notbooleanisOnline()Checks if this player is currently onlinebooleanisWhitelisted()Checks if this player is whitelisted or notvoidsetStatistic(Statistic statistic, int newValue)Sets the given statistic for this player.voidsetStatistic(Statistic statistic, EntityType entityType, int newValue)Sets the given statistic for this player for the given entity.voidsetStatistic(Statistic statistic, Material material, int newValue)Sets the given statistic for this player for the given material.voidsetWhitelisted(boolean value)Sets if this player is whitelisted or notMethods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializableserialize
- 
Method Details- 
isOnlineboolean isOnline()Checks if this player is currently online- Returns:
- true if they are online
 
- 
getNameReturns 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:
- getNamein interface- AnimalTamer
- Returns:
- Player name or null if we have not seen a name for this player yet
 
- 
getUniqueIdReturns the UUID of this player- Specified by:
- getUniqueIdin interface- AnimalTamer
- Returns:
- Player UUID
 
- 
isBannedboolean isBanned()Checks if this player is banned or not- Returns:
- true if banned, otherwise false
 
- 
isWhitelistedboolean isWhitelisted()Checks if this player is whitelisted or not- Returns:
- true if whitelisted
 
- 
setWhitelistedvoid setWhitelisted(boolean value)Sets if this player is whitelisted or not- Parameters:
- value- true if whitelisted
 
- 
getPlayerGets aPlayerobject that this represents, if there is oneIf the player is online, this will return that player. Otherwise, it will return null. - Returns:
- Online player
 
- 
getFirstPlayedlong 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
 
- 
getLastPlayedlong 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
 
- 
hasPlayedBeforeboolean hasPlayedBefore()Checks if this player has played on this server before.- Returns:
- True if the player has played before, otherwise false
 
- 
getBedSpawnLocationGets 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.
 
- 
incrementStatisticIncrements the given statistic for this player.This is equivalent to the following code: incrementStatistic(Statistic, 1)- Parameters:
- statistic- Statistic to increment
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if the statistic requires an additional parameter
 
- 
decrementStatisticDecrements the given statistic for this player.This is equivalent to the following code: decrementStatistic(Statistic, 1)- Parameters:
- statistic- Statistic to decrement
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if the statistic requires an additional parameter
 
- 
incrementStatisticIncrements the given statistic for this player.- Parameters:
- statistic- Statistic to increment
- amount- Amount to increment this statistic by
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if amount is negative
- IllegalArgumentException- if the statistic requires an additional parameter
 
- 
decrementStatisticDecrements the given statistic for this player.- Parameters:
- statistic- Statistic to decrement
- amount- Amount to decrement this statistic by
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if amount is negative
- IllegalArgumentException- if the statistic requires an additional parameter
 
- 
setStatisticSets the given statistic for this player.- Parameters:
- statistic- Statistic to set
- newValue- The value to set this statistic to
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if newValue is negative
- IllegalArgumentException- if the statistic requires an additional parameter
 
- 
getStatisticGets the value of the given statistic for this player.- Parameters:
- statistic- Statistic to check
- Returns:
- the value of the given statistic
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if the statistic requires an additional parameter
 
- 
incrementStatisticvoid incrementStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentExceptionIncrements the given statistic for this player for the given material.This is equivalent to the following code: incrementStatistic(Statistic, Material, 1)- Parameters:
- statistic- Statistic to increment
- material- Material to offset the statistic with
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if material is null
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
decrementStatisticvoid decrementStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentExceptionDecrements the given statistic for this player for the given material.This is equivalent to the following code: decrementStatistic(Statistic, Material, 1)- Parameters:
- statistic- Statistic to decrement
- material- Material to offset the statistic with
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if material is null
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
getStatisticint getStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentExceptionGets the value of the given statistic for this player.- Parameters:
- statistic- Statistic to check
- material- Material offset of the statistic
- Returns:
- the value of the given statistic
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if material is null
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
incrementStatisticvoid incrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int amount) throws IllegalArgumentExceptionIncrements the given statistic for this player for the given material.- Parameters:
- statistic- Statistic to increment
- material- Material to offset the statistic with
- amount- Amount to increment this statistic by
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if material is null
- IllegalArgumentException- if amount is negative
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
decrementStatisticvoid decrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int amount) throws IllegalArgumentExceptionDecrements the given statistic for this player for the given material.- Parameters:
- statistic- Statistic to decrement
- material- Material to offset the statistic with
- amount- Amount to decrement this statistic by
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if material is null
- IllegalArgumentException- if amount is negative
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
setStatisticvoid setStatistic(@NotNull Statistic statistic, @NotNull Material material, int newValue) throws IllegalArgumentExceptionSets the given statistic for this player for the given material.- Parameters:
- statistic- Statistic to set
- material- Material to offset the statistic with
- newValue- The value to set this statistic to
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if material is null
- IllegalArgumentException- if newValue is negative
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
incrementStatisticvoid incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) throws IllegalArgumentExceptionIncrements the given statistic for this player for the given entity.This is equivalent to the following code: incrementStatistic(Statistic, EntityType, 1)- Parameters:
- statistic- Statistic to increment
- entityType- EntityType to offset the statistic with
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if entityType is null
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
decrementStatisticvoid decrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) throws IllegalArgumentExceptionDecrements the given statistic for this player for the given entity.This is equivalent to the following code: decrementStatistic(Statistic, EntityType, 1)- Parameters:
- statistic- Statistic to decrement
- entityType- EntityType to offset the statistic with
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if entityType is null
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
getStatisticint getStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) throws IllegalArgumentExceptionGets the value of the given statistic for this player.- Parameters:
- statistic- Statistic to check
- entityType- EntityType offset of the statistic
- Returns:
- the value of the given statistic
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if entityType is null
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
incrementStatisticvoid incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int amount) throws IllegalArgumentExceptionIncrements the given statistic for this player for the given entity.- Parameters:
- statistic- Statistic to increment
- entityType- EntityType to offset the statistic with
- amount- Amount to increment this statistic by
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if entityType is null
- IllegalArgumentException- if amount is negative
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
decrementStatisticDecrements the given statistic for this player for the given entity.- Parameters:
- statistic- Statistic to decrement
- entityType- EntityType to offset the statistic with
- amount- Amount to decrement this statistic by
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if entityType is null
- IllegalArgumentException- if amount is negative
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
- 
setStatisticSets the given statistic for this player for the given entity.- Parameters:
- statistic- Statistic to set
- entityType- EntityType to offset the statistic with
- newValue- The value to set this statistic to
- Throws:
- IllegalArgumentException- if statistic is null
- IllegalArgumentException- if entityType is null
- IllegalArgumentException- if newValue is negative
- IllegalArgumentException- if the given parameter is not valid for the statistic
 
 
-