forked from PocketMine/PocketMine-MP
-
Notifications
You must be signed in to change notification settings - Fork 14
PlayerAPI
mc.getSendQueue().addToSendQueue(new Packet11PlayerPosition(Double.NaN, Double.NaN, Double.NaN, Double.NaN, true)) edited this page Aug 28, 2026
·
3 revisions
- PMMP (pre-plugin) - introduced
- NC 1.0.0 (pre-PMMP 1.3.12 merge, API 11) - added
multiple=falseparameter for PlayerAPI::get - NC 1.1.0 (1.0.2dev, API 12.1) - added
create=trueparameter for PlayerAPI::getOffline
WIP
- Description: Get a player by username.
-
Return:
falseif no player was not found, Player instance if player was found andmultipleisfalse, array of Player instances if at least one player was found andmultipleistrue -
Arguments:
-
mixed
name- Nickname of the player. Must be a string -
mixed
alike=true- Attempts to get player using only a part of his name using if true. -
mixed
multiple=false- makes the function return an array with all players that matched given parameters
-
mixed
- Args: (&name, &target)
name - reference to a variable which contains player nickname, target - reference to a variable which contains player nickname or "w:{worldname}"
- Returns: false if failed
- Args: (&name, &x, &y, &z)
name - reference to a variable which contains player nickname, &x/&y/&z - reference to a variable which contains x/y/z coordinate
- Returns: false if failed, true if success
- Args: (players, packet)
players - array of players, packet - RakNetDataPacket object
- Returs: None
- Args: None
- Returns: Array of players on server
- Args: (name)
name - username of Player, String
- Returns: Array with player data from players/ folder
- Args: (player)
player - instance of Player
- Returns: None
- Description: Spawn all other players to .
- Args: (level = null)
level, optional value, instance of Level
- Returns: Array with Players on all server or in specific world
- Args: (eid)
eid - eid of player, integer
- Returns: false if no players were found, Player instance if player was found
- Args: (player)
player - instance of [Player]]
- Returns: None
- Description: spawns to all other players
- Args: (CID)
CID - client id
- Returns: None