@ThreadSafe public class OfflinePlayer extends TridentInventoryHolder implements Player
| Modifier and Type | Field and Description |
|---|---|
protected PlayerAbilities |
abilities |
protected Dimension |
dimension
The dimension of the player
|
protected Inventory |
enderChest |
protected float |
exhaustion
The exaustion of the player
|
protected int |
foodTickTimer
The next ticks that will be run before the player drops in hunger
|
protected GameMode |
gameMode
The gamemode the player is currently in
|
protected short |
hunger
The current hunger of the player
|
protected String |
name
The name of the player
|
protected Set<String> |
permissions |
protected PlayerSpeed |
playerSpeed |
protected float |
saturation
The current food saturation of the player
|
protected int |
score
TODO
|
protected short |
selectedSlot
The current slot selected by the player
|
protected Position |
spawnPosition
The spawn location of the player
|
protected int |
xpLevel
The player's experience level
|
protected float |
xpPercent
The percentage of experience currently in the level
|
protected int |
xpSeed
The experience seed of the player
|
protected int |
xpTotal
The total numerical experience the player has
|
inventoryattributes, canPickup, dead, health, invincibilityTicks, maxHealth, restTicksairTicks, boundingBox, counter, displayName, executor, fallDistance, fireTicks, godMode, HANDLER, height, id, loc, nameVisible, onGround, passenger, portalCooldown, silent, ticksExisted, uniqueId, velocity, width| Modifier and Type | Method and Description |
|---|---|
CompoundTag |
asNbt() |
Player |
asPlayer()
Obtains this command issuer as a player
|
boolean |
connected()
Obtains whether this player is currently on the server or not
|
String |
footer()
Current footer on TAB, returns null if non-existent
|
GameMode |
gameMode()
Returns the GameMode the Player is in
|
static CompoundTag |
generatePlayer(UUID id) |
static OfflinePlayer |
getOfflinePlayer(UUID id) |
void |
grantPermission(String perm)
Offers the permission holder a permission which they can hold
|
String |
header()
Current header on TAB, returns null if non-existent
|
void |
hide(Entity entity)
Makes the specified entity invisible to the current entity
|
void |
invokeCommand(String message)
Issues a command from this sender, forcing them to run it
|
String |
lastCommand()
Gets the last command executed by this CommandIssuer, without the preceding "/"
|
EntityDamageEvent |
lastDamageEvent()
Returns the last EntityDamageEvent which inflicted this Entity
|
String |
lastMessage()
Gets the last message sent to this Messagable
|
Player |
lastPlayerDamager()
Returns the player who dealt damage to this Entity since its last full heal
|
<T extends Projectile> |
launchProjectile(EntityProperties properties)
Launch a projectile based on the given EntityProperties
|
Locale |
locale()
Returns the Player's
Locale settings |
String |
name()
The name of the player, matches that of Mojang servers
|
boolean |
opped()
Checks if the permission holder has operator status
|
boolean |
ownsPermission(String perm)
Observes the holder to see if it holds the specified permission
|
Item |
pickedItem() |
void |
revokePermission(String perm)
Removes the permission tag from the holder such that the next invocation of
PermissionOwner.ownsPermission(String)
returns false |
void |
sendBar(BarType barType,
String s)
Sends a bar accordingly to the type and the message.
|
void |
sendMessage(String message)
Sends the player a message
|
void |
sendRaw(String... messages)
Send an array of messages to this recipient
|
void |
sendTitle(String s)
Sends a regular title
|
void |
sendTitle(String s,
String s1)
Sends a title with a subtitle
|
void |
sendTitle(String s,
String s1,
TitleTransition titleTransition)
Sends a title with a subtitle and a transition
|
void |
sendTitle(String s,
TitleTransition titleTransition)
Sends a regular time with a transition
|
void |
setFooter(MessageBuilder builder) |
void |
setGameMode(GameMode mode)
Sets the player's gamemode to the specified gamemode
|
void |
setHeader(MessageBuilder builder) |
void |
setPickedItem(Item item) |
void |
show(Entity entity)
Un-hides the entity that was hidden from view, or does nothing of already visible
|
Position |
spawnLocation() |
PlayerSpeed |
speedModifiers()
Obtains the settings for the player's speed
|
heldItem, load, selectedSlot, setHeldItem, setSelectedSlot, windowaiHandler, aiModule, canCollectItems, createStatusEffect, doTick, encodeMetadata, headLocation, health, isDead, maxHealth, path, performAiUpdate, remainingAir, remove, setAiModule, setHealth, setMaxHealth, setPath, setRemainingAirapplyProperties, boundingBox, displayName, doEncodeMeta, doLoad, doRemove, eject, entityId, isNameVisible, isSilent, onGround, passenger, position, setDisplayName, setOnGround, setPassenger, setPosition, setSize, setVelocity, spawn, teleport, teleport, teleport, tick, type, uniqueId, velocity, withinRange, worldclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaiModule, canCollectItems, createStatusEffect, displayName, headLocation, health, isDead, maxHealth, path, remainingAir, setAiModule, setHealth, setMaxHealth, setPath, setRemainingAirheldItem, setHeldItem, windowapplyProperties, boundingBox, eject, entityId, isNameVisible, isSilent, onGround, passenger, position, remove, setDisplayName, setPassenger, setSize, setVelocity, teleport, teleport, teleport, type, uniqueId, velocity, withinRange, worldprotected volatile int score
protected volatile short selectedSlot
protected volatile Position spawnPosition
protected volatile short hunger
protected volatile float exhaustion
protected volatile float saturation
protected volatile int foodTickTimer
protected volatile int xpLevel
protected volatile float xpPercent
protected volatile int xpTotal
protected volatile int xpSeed
protected final Inventory enderChest
protected final PlayerAbilities abilities
protected final PlayerSpeed playerSpeed
protected final Set<String> permissions
public static OfflinePlayer getOfflinePlayer(UUID id)
public static CompoundTag generatePlayer(UUID id)
public Position spawnLocation()
public Locale locale()
PlayerLocale settingspublic GameMode gameMode()
Playerpublic void setGameMode(GameMode mode)
PlayersetGameMode in interface Playerpublic PlayerSpeed speedModifiers()
PlayerspeedModifiers in interface Playerpublic void sendMessage(String message)
PlayersendMessage in interface Playermessage - the message to display to the playerpublic boolean connected()
Playerpublic void invokeCommand(String message)
CommandIssuerinvokeCommand in interface CommandIssuerpublic String lastCommand()
CommandIssuerlastCommand in interface CommandIssuerpublic Player asPlayer()
CommandIssuerasPlayer in interface CommandIssuerpublic void hide(Entity entity)
LivingEntityHas no effect if the current entity is not a player
hide in interface LivingEntityhide in class TridentLivingEntityentity - the entity to make invisible to this entitypublic void show(Entity entity)
LivingEntityHas no effect if the current entity is not a player
show in interface LivingEntityshow in class TridentLivingEntityentity - the entity to make visible to this entitypublic EntityDamageEvent lastDamageEvent()
LivingEntityThe event may be cancelled.
lastDamageEvent in interface LivingEntitypublic Player lastPlayerDamager()
LivingEntityUsed for death messages
lastPlayerDamager in interface LivingEntitypublic void sendRaw(String... messages)
MessagablesendRaw in interface Messagablemessages - String[] messages to be sentpublic String lastMessage()
MessagablelastMessage in interface Messagablepublic String name()
Playerpublic <T extends Projectile> T launchProjectile(EntityProperties properties)
ProjectileLauncherlaunchProjectile in interface ProjectileLauncherlaunchProjectile in class TridentLivingEntitypublic CompoundTag asNbt()
asNbt in class TridentEntitypublic void grantPermission(String perm)
PermissionOwnerThis has no effect if the holder already has the given permission
grantPermission in interface PermissionOwnerperm - the new permission the holder should holdpublic void revokePermission(String perm)
PermissionOwnerPermissionOwner.ownsPermission(String)
returns falserevokePermission in interface PermissionOwnerperm - the permission to removepublic boolean ownsPermission(String perm)
PermissionOwnerownsPermission in interface PermissionOwnerperm - the permission to check if heldtrue if the permission is held, false if it is notpublic boolean opped()
PermissionOwneropped in interface PermissionOwnertrue to indicate that the holder is an operatorpublic void sendBar(BarType barType, String s)
BarReceiversendBar in interface BarReceiverbarType - the type of bars - the message on the barpublic void sendTitle(String s)
TitleReceiversendTitle in interface TitleReceivers - the title messagepublic void sendTitle(String s, String s1)
TitleReceiversendTitle in interface TitleReceivers - the title messages1 - the subtitle messagepublic void sendTitle(String s, TitleTransition titleTransition)
TitleReceiversendTitle in interface TitleReceivers - the title messagetitleTransition - the transition object for the titlepublic void sendTitle(String s, String s1, TitleTransition titleTransition)
TitleReceiversendTitle in interface TitleReceivers - the title messages1 - the subtitle messagetitleTransition - the transition object for the titlepublic Item pickedItem()
pickedItem in interface Playerpublic void setPickedItem(Item item)
setPickedItem in interface Playerpublic String header()
Playerpublic void setHeader(MessageBuilder builder)
public String footer()
Playerpublic void setFooter(MessageBuilder builder)
Copyright © 2016. All rights reserved.