Interface Player
- All Superinterfaces:
Audience
,BossBarViewer
,CommandSource
,Connection
,Entity
,LivingEntity
,PlayerInfoEntry
,Pointered
,Sound.Emitter
,Viewable
public interface Player
extends LivingEntity, CommandSource, PlayerInfoEntry, Connection, BossBarViewer
Represents a player.
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.sculkpowered.server.entity.Entity
Entity.Pose
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChatSuggestions
(@NotNull String... suggestions) Adds custom chat suggestions to the client.boolean
Gets whether the player is allowed to fly.void
allowFlight
(boolean allowFight) Sets whether the player is allowed to flyvoid
disconnect
(@NotNull Component reason) Disconnects the player with the specified reason.@Nullable Component
Gets the game mode of the player.void
displayName
(@Nullable Component displayName) Sets the display name of a player.boolean
flying()
Gets whether the player flies or not.void
flying
(boolean flying) Sets whether the player flies or not.float
Gets the flying speed of the player.void
flyingSpeed
(float flyingSpeed) Sets the flying speed of the player@NotNull GameMode
gameMode()
Gets the game mode of the player.void
Sets the game mode of a player.int
Gets the slot index of the currently held itemvoid
heldItemSlot
(int slot) Sets the current held item by its index.boolean
Gets whether the player can instantly break.void
instantBreak
(boolean instantBreak) Sets whether the player can instantly break.@NotNull Inventory
Gets the inventory of the player.@NotNull String
name()
Gets the name of the player.boolean
onGround()
Whether the player is on ground.void
openContainer
(@NotNull Container container) Opens the specified container.@Nullable Container
Gets the opened container.@NotNull GameProfile
profile()
Gets the profile of the player.void
removeChatSuggestions
(@NotNull String... suggestions) Removes custom chat suggestions to the client.void
sendPluginMessage
(@NotNull String identifier, byte @NotNull [] data) Sends a plugin message.void
setChatSuggestions
(@NotNull String... suggestions) Sets the custom chat suggestions of the client.@NotNull PlayerSettings
settings()
Gets the settings of the player.float
Gets the view modifier of the player.void
viewModifier
(float viewModifier) Sets the view modifier of the player.Methods inherited from interface net.kyori.adventure.audience.Audience
clearResourcePacks, clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
Methods inherited from interface net.kyori.adventure.bossbar.BossBarViewer
activeBossBars
Methods inherited from interface eu.sculkpowered.server.command.CommandSource
hasPermission
Methods inherited from interface eu.sculkpowered.server.connection.Connection
address, protocolVersion
Methods inherited from interface eu.sculkpowered.server.entity.Entity
crouching, customName, customName, customNameVisible, customNameVisible, glowing, glowing, gravity, hasGravity, id, invisible, invisible, onFire, pose, pose, position, silent, silent, sprinting, swimming, teleport, type, uniqueId, velocity, velocity, world, world
Methods inherited from interface eu.sculkpowered.server.entity.LivingEntity
attribute, equipment, health, health, isPotionEffectAmbient, numberOfArrows, numberOfArrows, numberOfBeeStingers, numberOfBeeStingers, potionEffectAmbient, potionEffectColor, potionEffectColor
Methods inherited from interface eu.sculkpowered.server.entity.player.PlayerInfoEntry
ping
Methods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
Methods inherited from interface eu.sculkpowered.server.Viewable
addViewer, removeViewer, viewers
-
Field Details
-
BLOCK_BREAK_SPEED
-
BLOCK_INTERACTION_RANGE
-
ENTITY_INTERACTION_RANGE
-
MINING_EFFICIENCY
-
SNEAKING_SPEED
-
-
Method Details
-
name
Gets the name of the player.- Returns:
- the player's name
- Since:
- 1.0.0
-
profile
Gets the profile of the player.- Specified by:
profile
in interfacePlayerInfoEntry
- Returns:
- the player's profile
- Since:
- 1.0.0
-
settings
Gets the settings of the player.- Returns:
- the player's settings
- Since:
- 1.0.0
-
gameMode
Gets the game mode of the player.- Specified by:
gameMode
in interfacePlayerInfoEntry
- Returns:
- the player's game mode
- Since:
- 1.0.0
-
gameMode
Sets the game mode of a player.- Parameters:
gameMode
- the game mode to set- Since:
- 1.0.0
-
displayName
Gets the game mode of the player.- Specified by:
displayName
in interfacePlayerInfoEntry
- Returns:
- the player's game mode
- Since:
- 1.0.0
-
displayName
Sets the display name of a player.- Parameters:
displayName
- the display name to set- Since:
- 1.0.0
-
disconnect
Disconnects the player with the specified reason.- Parameters:
reason
- the reason of the disconnect- Since:
- 1.0.0
-
inventory
Gets the inventory of the player.- Returns:
- the player's inventory
- Since:
- 1.0.0
-
openedContainer
Gets the opened container.- Returns:
- the opened container or
null
if nothing is opened - Since:
- 1.0.0
-
openContainer
Opens the specified container.- Parameters:
container
- the container to open- Since:
- 1.0.0
-
heldItemSlot
int heldItemSlot()Gets the slot index of the currently held item- Returns:
- the held item slot index
- Since:
- 1.0.0
-
heldItemSlot
void heldItemSlot(int slot) Sets the current held item by its index.- Parameters:
slot
- the slot- Since:
- 1.0.0
-
flying
boolean flying()Gets whether the player flies or not.- Returns:
- whether the player flies or not
- Since:
- 1.0.0
-
flying
void flying(boolean flying) Sets whether the player flies or not.- Parameters:
flying
- whether the player flies or not- Since:
- 1.0.0
-
allowFlight
boolean allowFlight()Gets whether the player is allowed to fly.- Returns:
- whether the player is allowed to fly
- Since:
- 1.0.0
-
allowFlight
void allowFlight(boolean allowFight) Sets whether the player is allowed to fly- Parameters:
allowFight
- whether the player is allowed to fly- Since:
- 1.0.0
-
flyingSpeed
float flyingSpeed()Gets the flying speed of the player.- Returns:
- the player's flying speed
- Since:
- 1.0.0
-
flyingSpeed
void flyingSpeed(float flyingSpeed) Sets the flying speed of the player- Parameters:
flyingSpeed
- the flying speed to set- Since:
- 1.0.0
-
instantBreak
@Experimental boolean instantBreak()Gets whether the player can instantly break.- Returns:
- whether the player can instantly break
- Since:
- 1.0.0
-
instantBreak
@Experimental void instantBreak(boolean instantBreak) Sets whether the player can instantly break.- Parameters:
instantBreak
- whether the player can instantly break- Since:
- 1.0.0
-
viewModifier
float viewModifier()Gets the view modifier of the player.- Returns:
- the player's view modifier
- Since:
- 1.0.0
-
viewModifier
void viewModifier(float viewModifier) Sets the view modifier of the player.- Parameters:
viewModifier
- the view modifier to set- Since:
- 1.0.0
-
sendPluginMessage
Sends a plugin message.- Parameters:
identifier
- the identifierdata
- the data to send
-
onGround
boolean onGround()Whether the player is on ground.- Returns:
- whether the player is on ground
- Since:
- 1.0.0
-
addChatSuggestions
Adds custom chat suggestions to the client.- Parameters:
suggestions
- the suggestions to add- Since:
- 1.0.0
-
removeChatSuggestions
Removes custom chat suggestions to the client.- Parameters:
suggestions
- the suggestions to remove- Since:
- 1.0.0
-
setChatSuggestions
Sets the custom chat suggestions of the client.- Parameters:
suggestions
- the suggestions to set- Since:
- 1.0.0
-