Skip to content

PlayerAPI

mc.getSendQueue().addToSendQueue(new Packet11PlayerPosition(Double.NaN, Double.NaN, Double.NaN, Double.NaN, true)) edited this page Aug 28, 2026 · 3 revisions

Changelog (pre-NC changes are not listed here)

  • PMMP (pre-plugin) - introduced
  • NC 1.0.0 (pre-PMMP 1.3.12 merge, API 11) - added multiple=false parameter for PlayerAPI::get
  • NC 1.1.0 (1.0.2dev, API 12.1) - added create=true parameter for PlayerAPI::getOffline

WIP

Functions

get(name, alike=true, multiple=false)

  • Description: Get a player by username.
  • Return: false if no player was not found, Player instance if player was found and multiple is false, array of Player instances if at least one player was found and multiple is true
  • 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

teleport

  • 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

tppos

  • 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

broadcastPacket

  • Args: (players, packet)

players - array of players, packet - RakNetDataPacket object

  • Returs: None

online

  • Args: None
  • Returns: Array of players on server

getOffline

  • Args: (name)

name - username of Player, String

  • Returns: Array with player data from players/ folder

spawnAllPlayers

  • Args: (player)

player - instance of Player

  • Returns: None
  • Description: Spawn all other players to .

getAll

  • Args: (level = null)

level, optional value, instance of Level

  • Returns: Array with Players on all server or in specific world

getByEID

  • Args: (eid)

eid - eid of player, integer

  • Returns: false if no players were found, Player instance if player was found

spawnToAllPlayers

  • Args: (player)

player - instance of [Player]]

  • Returns: None
  • Description: spawns to all other players

remove

  • Args: (CID)

CID - client id

  • Returns: None

Clone this wiki locally