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
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChatSuggestions(@NotNull String... suggestions) Adds custom chat suggestions to the client.booleanGets whether the player is allowed to fly.voidallowFlight(boolean allowFight) Sets whether the player is allowed to flyvoiddisconnect(@NotNull Component reason) Disconnects the player with the specified reason.@Nullable ComponentGets the game mode of the player.voiddisplayName(@Nullable Component displayName) Sets the display name of a player.booleanflying()Gets whether the player flies or not.voidflying(boolean flying) Sets whether the player flies or not.floatGets the flying speed of the player.voidflyingSpeed(float flyingSpeed) Sets the flying speed of the player@NotNull GameModegameMode()Gets the game mode of the player.voidSets the game mode of a player.intGets the slot index of the currently held itemvoidheldItemSlot(int slot) Sets the current held item by its index.booleanGets whether the player can instantly break.voidinstantBreak(boolean instantBreak) Sets whether the player can instantly break.@NotNull InventoryGets the inventory of the player.@NotNull Stringname()Gets the name of the player.booleanonGround()Whether the player is on ground.voidopenContainer(@NotNull Container container) Opens the specified container.@Nullable ContainerGets the opened container.@NotNull GameProfileprofile()Gets the profile of the player.voidremoveChatSuggestions(@NotNull String... suggestions) Removes custom chat suggestions to the client.voidsendPluginMessage(@NotNull String identifier, byte @NotNull [] data) Sends a plugin message.voidsetChatSuggestions(@NotNull String... suggestions) Sets the custom chat suggestions of the client.@NotNull PlayerSettingssettings()Gets the settings of the player.floatGets the view modifier of the player.voidviewModifier(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, stopSoundMethods inherited from interface net.kyori.adventure.bossbar.BossBarViewer
activeBossBarsMethods inherited from interface eu.sculkpowered.server.command.CommandSource
hasPermissionMethods inherited from interface eu.sculkpowered.server.connection.Connection
address, protocolVersionMethods 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, worldMethods inherited from interface eu.sculkpowered.server.entity.LivingEntity
attribute, equipment, health, health, isPotionEffectAmbient, numberOfArrows, numberOfArrows, numberOfBeeStingers, numberOfBeeStingers, potionEffectAmbient, potionEffectColor, potionEffectColorMethods inherited from interface eu.sculkpowered.server.entity.player.PlayerInfoEntry
pingMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointersMethods 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:
profilein 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:
gameModein 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:
displayNamein 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
nullif 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
-