Package net.pl3x.map.core.player
Class Player
java.lang.Object
net.pl3x.map.core.Keyed
net.pl3x.map.core.player.Player
Represents a player.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabstract intGet the player's current armor points.Get the player's decorated name.abstract intGet the player's current healthabstract StringgetName()Get the player's name.<T> Tabstract PointGet the player's current position.abstract @Nullable URLgetSkin()Get the player's skin URL.abstract UUIDgetUUID()Get the player's UUID.abstract WorldgetWorld()Get the world this player is currently in.abstract floatgetYaw()Get the player's current yaw.inthashCode()booleanisHidden()Get whether player is hidden from the map.abstract booleanGet whether the player is invisible.abstract booleanisNPC()Get whether the player is an NPC.abstract booleanGet whether the player has hidden flag set persistently.abstract booleanGet whether the player is in spectator gamemode.voidregisterNameDecorator(int priority, BiFunction<Player, String, String> decorator) Function that is used to change player name in a player listvoidsetHidden(boolean hidden, boolean persistent) Set if the player is hidden from the mapabstract voidsetPersistentlyHidden(boolean hidden) Set whether the player has hidden flag set persistently.void
-
Constructor Details
-
Player
-
-
Method Details
-
getPlayer
public <T> T getPlayer() -
setPlayer
-
getName
Get the player's name.- Returns:
- player's name
-
getUUID
Get the player's UUID.- Returns:
- player's UUID
-
getWorld
Get the world this player is currently in.- Returns:
- player's world
-
getPosition
Get the player's current position.- Returns:
- player's position
-
getYaw
public abstract float getYaw()Get the player's current yaw.- Returns:
- player's yaw
-
getHealth
public abstract int getHealth()Get the player's current health- Returns:
- player's health
-
getArmorPoints
public abstract int getArmorPoints()Get the player's current armor points.- Returns:
- player's armor points
-
getSkin
Get the player's skin URL.- Returns:
- player's skin URL
-
isInvisible
public abstract boolean isInvisible()Get whether the player is invisible.- Returns:
- true if player is invisible
-
isNPC
public abstract boolean isNPC()Get whether the player is an NPC.This is for things like the Citizens plugin.
- Returns:
- true if player is an NPC
-
isSpectator
public abstract boolean isSpectator()Get whether the player is in spectator gamemode.- Returns:
- true if player is spectator
-
isHidden
public boolean isHidden()Get whether player is hidden from the map.- Returns:
- true if player is hidden
-
setHidden
public void setHidden(boolean hidden, boolean persistent) Set if the player is hidden from the map- Parameters:
hidden- True to hide, false to showpersistent- True to persist this state
-
isPersistentlyHidden
public abstract boolean isPersistentlyHidden()Get whether the player has hidden flag set persistently.- Returns:
- true if player is persistently hidden
-
setPersistentlyHidden
public abstract void setPersistentlyHidden(boolean hidden) Set whether the player has hidden flag set persistently.- Parameters:
hidden- true to persistently hide player
-
registerNameDecorator
Function that is used to change player name in a player listMultiple decorators can be registered at the same time, in that case the one with Integer.MAX_VALUE will be run as first These two values should be used only in addons that you do not plan to release for public use.
The function takes two arguments - the player and the output of previous decorator
- Parameters:
priority- Priority of decoratordecorator- Name decorator to register
-
getDecoratedName
Get the player's decorated name.- Returns:
- decorated name
-
equals
-
hashCode
public int hashCode()
-