Player Component Method
Get Player instance
Get player instance through Event instance
Requires Event instance
Return Player instance
Get Player name by Player instance
Get player instance by player name
Requires String
Return Player instance
Get Enchantment Event by Player instance
Get player instance through enchantment event, can only be used in Enchantment event
Requires Event instance
Return Player instance
Get current Health of Player by Player instance
Can obtain the current health of the player
Requires Player instance
Return Number
Set current Health of player
Can set the current health of the player
Requires Player instance
, Number
Get Player Name
Can get the name of the player
Requires Player instance
Return String
Check if Player Has Permission
Can determine if the player has the permission by the returned boolean value, useful for distinguishing between administrators and regular players
Requires Player instance
, String
Return Boolean
Set Player Fly Mode
Set the fly mode for the player
Requires Player instance
, Boolean
Send Title to Player
Can write the title to be displayed to the player, 20 Ticks = 1 second
Requires three texts
Reset Title
Clears the current title of the player
Requires Player instance
Get Player Location instance
Get the player's Location instance
for subsequent operations
Requires Player instance
Return Location instance
Set Player Spawn
Set the player's spawn point with the coordinates provided by the Location instance
Requires Player instance
, Location instance
Get Player UUID
Obtain the player's UUID through the Player instance
Requires Player instance
Return String
Get Player Max Health
Get the player's maximum health through the Player instance
, default is 20
Requires Player instance
Return Number
Get Player Level
Get the player's level through the Player instance
Requires Player instance
Return Number
Set Player Level
Set the player's level
Requires Player instance
, Number
Get Player Fly Speed
Get the player's fly speed through the Player instance
Requires Player instance
Return Number
Get Player Ping
Get the player's current latency
Requires Player instance
Return Number
Get Player Satiety Degree
Get the player's current hunger level
Requires Player instance
Return Number
Set Player Satiety Degree
Set the player's hunger level
Requires Player instance
, Number
Check if Player can Fly
Determine if the player can fly, can be used for checks
Requires Player instance
Return Boolean
Get Player Bed
Get the position of the player's bed. Note: there may be issues or errors if the player does not have a bed!
Requires Player instance
Return location instance
Get Player Attack cooling
Get the player's attack cooldown. Note: this can only be used with the Combat System Update (1.9) or higher!
Requires Player instance
Return Number
Check if Player is OP
Check if the player is an OP player. The returned boolean value can be used for judgments.
Requires Player instance
Return Boolean
Teleport Player to a Location instance
Teleport the player to the position provided by the location instance
Requires Player instance
, location instance
Set Player Max Health
Set the player's maximum health, default is 20
Requires Player instance
, Number
Get Player Name in TAB
Get the name displayed when other players press the TAB key
Requires Player instance
Return String
Set Player Name in TAB
Set the name displayed in the list when other players press the TAB key
Requires Player instance
, String
Set Player Weather
Set the weather visible to the player, which may differ from the world weather. For weather types, see Weather Types
Requires Player instance
, String
Set Player Time
Set the player's time, where 20 ticks = 1 second
Requires Player instance
, Number
Set Player Relative Time
If relative time is true, the player's time will vary with the world time while maintaining an offset; otherwise, the client's time remains fixed.
Note: If relative time is true, the value of time represents the difference between the client's time and the world time. If false, time represents an absolute value.
Requires Player instance
, String
, Boolean
Reset Player Time
Restore the player's time to the default value, synchronizing with world time
Requires Player instance
Get Player Walk Speed
Get the current walking speed of the player
Requires Player instance
Return Number
Set Player Walk Speed
Set the current walking speed of the player
Requires Player instance
, Number
Set whether players are allowed to pick up items
Set whether the player is allowed to pick up items; false allows picking up, true prohibits*
Requires Player instance
, Boolean
Close the player backpack window
If the player is in the backpack or chest interface, it will close and return to the game
Requires Player instance
Generate particles
Generate a corresponding number of particles at the specified location. For particle types, see Particle Types
Requires Player instance
, String
, three coordinate numbers
, Number
Generate particles
Generate a corresponding number of particles at the position provided by the location instance. For particle types, see Particle Types
Requires Player instance
, String
, location instance
, Number
Set TAB Content (3)
You can set the content for the upper and lower rows in the TAB list using the first two methods, or set both at once with the third method, depending on your design
Requires Player instance
, n texts
Kick Player
Kick a player from the server
Requires Player instance
, String
Set up damage absorption
Set the damage absorbed by the player
Requires Player instance
, Number
Check if it is visible
Check if other players can see this player (invisibility), can be used for judgment
Requires Player instance
Return Boolean
Check if it is in the water
Check if the player is in water at the moment, can be used for judgment
Requires Player instance
Return Boolean
Play sound for players
Play a sound effect for the player. For sound types, see Sound Types
Requires Player instance
, String
, 2 numbers
Get game mode
Get the player's current game mode. For game mode types, see Game Mode Types
Requires Player instance
Return String
Set Game Mode
Set the player's current game mode. For game mode types, see Game Mode Types
Requires Player instance
, String
Adding Potion Effect
Add the corresponding potion effect to the player. For potion effect types, see Potion Effect Types
Requires Player instance
, String
, 2 numbers
Set highlighted players
Whether to make the player glow; true
for glowing, false
for not glowing
Requires Player instance
, Boolean
Provide players with experience
Give the player the corresponding experience
Requires Player instance
, Number
Give players a level
Give the player the corresponding level
Requires Player instance
, Number
Set the target pointed by the player's compass
Can set the position pointed to by the player's compass
Requires Player instance
, location instance
Set player display and hide
When the boolean is true
, all players will skip the night without waiting for the renamed player to sleep; false
is the opposite
Requires Player instance
, Boolean
Determine whether the player is ignoring sleep
Determine if this player needs to sleep to skip the night; true
means yes, false
means no
Requires Player instance
Return Boolean
Check if the player is currently sleeping
Determine if the player is currently sleeping; true
means yes, false
means no
Requires Player instance
Return Boolean
Set Player's Total Experience
Set the player's total experience points; note, this sets rather than adds
Requires Player instance
, Number
Get Player's Total Experience
Retrieve the player's total experience points
Requires Player instance
Return Number
Give Player Items
Give the player a specified quantity of a specified item. For item types, see Item Types
Requires Player instance
, String
, Number
*
Set/Cancel Player Glow for Specific Player
Set or cancel glow for a player visible only to a specific player; requires ProtocolLib
dependency
Requires 2 player instances
Set Player's Vector
Set the player's instantaneous vector, applying a directional force similar to a jump pad effect
Requires Player instance
, 3 numbers
Teleport Player to Another Subserver
Teleport the player to another subserver; note, requires BungeeCord connection
Requires Player instance
, String
Give Player Money
Give the player a certain amount of money; requires Vault
dependency
Requires Player instance
, Number
Take Money from Player
Remove a certain amount of money from the player; requires Vault
dependency
Requires Player instance
, Number
Get Player's Money Amount
Retrieve the player's total money
Requires Player instance
Return Number
Check if Player Has Sufficient Money
Check if the player has sufficient money; can be used for validation
Requires Player instance
, Number
Return Boolean
Get the Killer of Player
Get the player who killed this player; available in Player Death
event
Requires Player instance
Return Player instance
Set Player ActionBar
Set the player's ActionBar; to display it permanently, you may need to use a loop
Requires Player instance
, String
Get Item in Player's Hand
Get the item the player is holding, returning the corresponding text; for item types, see Item Types*
Requires Player instance
Return String
Get Player Display Name
Retrieve the display name of the Player instance
Requires Player instance
Return String
Set Player Display Name
Set the display name of the player
Requires Player instance
, String
Get Player Triggering this PAPI Placeholder
Get the player triggering this PAPI placeholder. Note: Can only be used in PAPI methods, otherwise an error will occur!
Return Player instance