|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Player
Represents a player, connected or not
Method Summary | ||
---|---|---|
void |
awardAchievement(Achievement achievement)
Awards this player the given achievement |
|
boolean |
canSee(Player player)
Checks to see if a player has been hidden from this player |
|
void |
chat(String msg)
Says a message (or runs a command). |
|
InetSocketAddress |
getAddress()
Gets the socket address of this player |
|
boolean |
getAllowFlight()
Determines if the Player is allowed to fly via jump key double-tap like in creative mode. |
|
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. |
|
Location |
getCompassTarget()
Get the previously set compass target. |
|
String |
getDisplayName()
Gets the "friendly" name to display of this player. |
|
float |
getExhaustion()
Gets the players current exhaustion level. |
|
float |
getExp()
Gets the players current experience points towards the next level. |
|
float |
getFlySpeed()
Gets the current allowed speed that a client can fly. |
|
int |
getFoodLevel()
Gets the players current food level |
|
int |
getLevel()
Gets the players current experience level |
|
String |
getPlayerListName()
Gets the name that is shown on the player list. |
|
long |
getPlayerTime()
Returns the player's current timestamp. |
|
long |
getPlayerTimeOffset()
Returns the player's current time offset relative to server time, or the current player's fixed time if the player's time is absolute. |
|
WeatherType |
getPlayerWeather()
Returns the type of weather the player is currently experiencing. |
|
float |
getSaturation()
Gets the players current saturation level. |
|
int |
getTotalExperience()
Gets the players total experience points |
|
float |
getWalkSpeed()
Gets the current allowed speed that a client can walk. |
|
void |
giveExp(int amount)
Gives the player the amount of experience specified. |
|
void |
giveExpLevels(int amount)
Gives the player the amount of experience levels specified. |
|
void |
hidePlayer(Player player)
Hides a player from this player |
|
void |
incrementStatistic(Statistic statistic)
Increments the given statistic for this player |
|
void |
incrementStatistic(Statistic statistic,
int amount)
Increments the given statistic for this player |
|
void |
incrementStatistic(Statistic statistic,
Material material)
Increments the given statistic for this player for the given material |
|
void |
incrementStatistic(Statistic statistic,
Material material,
int amount)
Increments the given statistic for this player for the given material |
|
boolean |
isFlying()
Checks to see if this player is currently flying or not. |
|
boolean |
isOnGround()
Deprecated. Inconsistent with org.bukkit.craftbukkit.entity.Entity#isOnGround() |
|
boolean |
isPlayerTimeRelative()
Returns true if the player's time is relative to the server time, otherwise the player's time is absolute and will not change its current time unless done so with setPlayerTime(). |
|
boolean |
isSleepingIgnored()
Returns whether the player is sleeping ignored. |
|
boolean |
isSneaking()
Returns if the player is in sneak mode |
|
boolean |
isSprinting()
Gets whether the player is sprinting or not. |
|
void |
kickPlayer(String message)
Kicks player with custom kick message. |
|
void |
loadData()
Loads the players current location, health, inventory, motion, and other information from the username.dat file, in the world/player folder Note: This will overwrite the players current inventory, health, motion, etc, with the state from the saved dat file. |
|
boolean |
performCommand(String command)
Makes the player perform the given command |
|
void |
playEffect(Location loc,
Effect effect,
int data)
Plays an effect to just this player. |
|
|
playEffect(Location loc,
Effect effect,
T data)
Plays an effect to just this player. |
|
void |
playNote(Location loc,
byte instrument,
byte note)
Play a note for a player at a location. |
|
void |
playNote(Location loc,
Instrument instrument,
Note note)
Play a note for a player at a location. |
|
void |
playSound(Location location,
Sound sound,
float volume,
float pitch)
Play a sound for a player at the location. |
|
void |
resetPlayerTime()
Restores the normal condition where the player's time is synchronized with the server time. |
|
void |
resetPlayerWeather()
Restores the normal condition where the player's weather is controlled by server conditions. |
|
void |
saveData()
Saves the players current location, health, inventory, motion, and other information into the username.dat file, in the world/player folder |
|
void |
sendBlockChange(Location loc,
int material,
byte data)
Send a block change. |
|
void |
sendBlockChange(Location loc,
Material material,
byte data)
Send a block change. |
|
boolean |
sendChunkChange(Location loc,
int sx,
int sy,
int sz,
byte[] data)
Send a chunk change. |
|
void |
sendMap(MapView map)
Render a map and send it to the player in its entirety. |
|
void |
sendRawMessage(String message)
Sends this sender a message raw |
|
void |
setAllowFlight(boolean flight)
Sets if the Player is allowed to fly via jump key double-tap like in creative mode. |
|
void |
setBedSpawnLocation(Location location)
Sets the Location where the player will spawn at their bed. |
|
void |
setBedSpawnLocation(Location location,
boolean force)
Sets the Location where the player will spawn at their bed. |
|
void |
setCompassTarget(Location loc)
Set the target of the player's compass. |
|
void |
setDisplayName(String name)
Sets the "friendly" name to display of this player. |
|
void |
setExhaustion(float value)
Sets the players current exhaustion level |
|
void |
setExp(float exp)
Sets the players current experience points towards the next level This is a percentage value. |
|
void |
setFlying(boolean value)
Makes this player start or stop flying. |
|
void |
setFlySpeed(float value)
Sets the speed at which a client will fly. |
|
void |
setFoodLevel(int value)
Sets the players current food level |
|
void |
setLevel(int level)
Sets the players current experience level |
|
void |
setPlayerListName(String name)
Sets the name that is shown on the in-game player list. |
|
void |
setPlayerTime(long time,
boolean relative)
Sets the current time on the player's client. |
|
void |
setPlayerWeather(WeatherType type)
Sets the type of weather the player will see. |
|
void |
setSaturation(float value)
Sets the players current saturation level |
|
void |
setSleepingIgnored(boolean isSleeping)
Sets whether the player is ignored as not sleeping. |
|
void |
setSneaking(boolean sneak)
Sets the sneak mode the player |
|
void |
setSprinting(boolean sprinting)
Sets whether the player is sprinting or not. |
|
void |
setTexturePack(String url)
Request that the player's client download and switch texture packs. |
|
void |
setTotalExperience(int exp)
Sets the players current experience level |
|
void |
setWalkSpeed(float value)
Sets the speed at which a client will walk. |
|
void |
showPlayer(Player player)
Allows this player to see a player that was previously hidden |
|
void |
updateInventory()
Deprecated. This method should not be relied upon as it is a temporary work-around for a larger, more complicated issue. |
Methods inherited from interface org.bukkit.entity.HumanEntity |
---|
closeInventory, getEnderChest, getExpToLevel, getGameMode, getInventory, getItemInHand, getItemOnCursor, getName, getOpenInventory, getSleepTicks, isBlocking, isSleeping, openEnchanting, openInventory, openInventory, openWorkbench, setGameMode, setItemInHand, setItemOnCursor, setWindowProperty |
Methods inherited from interface org.bukkit.entity.Damageable |
---|
damage, damage, getHealth, getMaxHealth, resetMaxHealth, setHealth, setMaxHealth |
Methods inherited from interface org.bukkit.permissions.Permissible |
---|
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment |
Methods inherited from interface org.bukkit.permissions.ServerOperator |
---|
isOp, setOp |
Methods inherited from interface org.bukkit.conversations.Conversable |
---|
abandonConversation, abandonConversation, acceptConversationInput, beginConversation, isConversing |
Methods inherited from interface org.bukkit.command.CommandSender |
---|
getName, getServer, sendMessage, sendMessage |
Methods inherited from interface org.bukkit.permissions.Permissible |
---|
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment |
Methods inherited from interface org.bukkit.permissions.ServerOperator |
---|
isOp, setOp |
Methods inherited from interface org.bukkit.OfflinePlayer |
---|
getFirstPlayed, getLastPlayed, getName, getPlayer, hasPlayedBefore, isBanned, isOnline, isWhitelisted, setBanned, setWhitelisted |
Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable |
---|
serialize |
Methods inherited from interface org.bukkit.plugin.messaging.PluginMessageRecipient |
---|
getListeningPluginChannels, sendPluginMessage |
Method Detail |
---|
String getDisplayName()
void setDisplayName(String name)
name
- The new display name.String getPlayerListName()
void setPlayerListName(String name)
ChatColor
is supported.
If the value is null, the name will be identical to HumanEntity.getName()
.
This name is case sensitive and unique, two names with different casing will
appear as two different people. If a player joins afterwards with
a name that conflicts with a player's custom list name, the
joining player's player list name will have a random number appended to it
(1-2 characters long in the default implementation). If the joining
player's name is 15 or 16 characters long, part of the name will
be truncated at the end to allow the addition of the two digits.
name
- new player list name
IllegalArgumentException
- if the name is already used by someone else
IllegalArgumentException
- if the length of the name is too longvoid setCompassTarget(Location loc)
loc
- Location to point toLocation getCompassTarget()
InetSocketAddress getAddress()
void sendRawMessage(String message)
sendRawMessage
in interface Conversable
message
- Message to be displayedvoid kickPlayer(String message)
message
- kick messagevoid chat(String msg)
msg
- message to printboolean performCommand(String command)
command
- Command to perform
boolean isSneaking()
void setSneaking(boolean sneak)
sneak
- true if player should appear sneakingboolean isSprinting()
void setSprinting(boolean sprinting)
sprinting
- true if the player should be sprintingvoid saveData()
void loadData()
void setSleepingIgnored(boolean isSleeping)
isSleeping
- Whether to ignore.boolean isSleepingIgnored()
void playNote(Location loc, byte instrument, byte note)
loc
- The location of a note block.instrument
- The instrument ID.note
- The note ID.void playNote(Location loc, Instrument instrument, Note note)
loc
- The location of a note blockinstrument
- The instrumentnote
- The notevoid playSound(Location location, Sound sound, float volume, float pitch)
location
- The location to play the soundsound
- The sound to playvolume
- The volume of the soundpitch
- The pitch of the soundvoid playEffect(Location loc, Effect effect, int data)
loc
- the location to play the effect ateffect
- the Effect
data
- a data bit needed for some effects<T> void playEffect(Location loc, Effect effect, T data)
loc
- the location to play the effect ateffect
- the Effect
data
- a data bit needed for some effectsvoid sendBlockChange(Location loc, Material material, byte data)
loc
- The location of the changed blockmaterial
- The new blockdata
- The block databoolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data)
loc
- The location of the cuboidsx
- The x size of the cuboidsy
- The y size of the cuboidsz
- The z size of the cuboiddata
- The data to be sent
void sendBlockChange(Location loc, int material, byte data)
loc
- The location of the changed blockmaterial
- The new block IDdata
- The block datavoid sendMap(MapView map)
map
- The map to be sent@Deprecated void updateInventory()
void awardAchievement(Achievement achievement)
achievement
- Achievement to awardvoid incrementStatistic(Statistic statistic)
statistic
- Statistic to incrementvoid incrementStatistic(Statistic statistic, int amount)
statistic
- Statistic to incrementamount
- Amount to increment this statistic byvoid incrementStatistic(Statistic statistic, Material material)
statistic
- Statistic to incrementmaterial
- Material to offset the statistic withvoid incrementStatistic(Statistic statistic, Material material, int amount)
statistic
- Statistic to incrementmaterial
- Material to offset the statistic withamount
- Amount to increment this statistic byvoid setPlayerTime(long time, boolean relative)
time
- The current player's perceived time or the player's time offset from the server time.relative
- When true the player time is kept relative to its world time.long getPlayerTime()
long getPlayerTimeOffset()
boolean isPlayerTimeRelative()
void resetPlayerTime()
void setPlayerWeather(WeatherType type)
resetPlayerWeather()
is
used.
type
- The WeatherType enum type the player should experienceWeatherType getPlayerWeather()
void resetPlayerWeather()
void giveExp(int amount)
amount
- Exp amount to givevoid giveExpLevels(int amount)
amount
- amount of experience levels to give or takefloat getExp()
void setExp(float exp)
exp
- New experience pointsint getLevel()
void setLevel(int level)
level
- New experience levelint getTotalExperience()
void setTotalExperience(int exp)
exp
- New experience levelfloat getExhaustion()
void setExhaustion(float value)
value
- Exhaustion levelfloat getSaturation()
void setSaturation(float value)
value
- Exhaustion levelint getFoodLevel()
void setFoodLevel(int value)
value
- New food levelLocation getBedSpawnLocation()
getBedSpawnLocation
in interface OfflinePlayer
void setBedSpawnLocation(Location location)
location
- where to set the respawn locationvoid setBedSpawnLocation(Location location, boolean force)
location
- where to set the respawn locationforce
- whether to forcefully set the respawn location even if a valid bed is not presentboolean getAllowFlight()
void setAllowFlight(boolean flight)
flight
- If flight should be allowed.void hidePlayer(Player player)
player
- Player to hidevoid showPlayer(Player player)
player
- Player to showboolean canSee(Player player)
player
- Player to check
@Deprecated boolean isOnGround()
org.bukkit.craftbukkit.entity.Entity#isOnGround()
isOnGround
in interface Entity
boolean isFlying()
void setFlying(boolean value)
value
- True to fly.void setFlySpeed(float value) throws IllegalArgumentException
value
- The new speed, from -1 to 1.
IllegalArgumentException
- If new speed is less than -1 or greater than 1void setWalkSpeed(float value) throws IllegalArgumentException
value
- The new speed, from -1 to 1.
IllegalArgumentException
- If new speed is less than -1 or greater than 1float getFlySpeed()
float getWalkSpeed()
void setTexturePack(String url)
url
- The URL from which the client will download the texture pack. The string must contain
only US-ASCII characters and should be encoded as per RFC 1738.
IllegalArgumentException
- Thrown if the URL is null.
IllegalArgumentException
- Thrown if the URL is too long.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |