Skip to content

QueryAPI

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

Changelog

  • NC 1.1.0 (1.0.2dev, API 12.1) - Introduced
  • NC 1.1.0 (1.1.0 beta 4, API 12.1) - Removed NFV(Not Found Value) class. NOT_FOUND_VALUE is now null instead of the instance of NFV.

API for adding data into query. Note: You should not use it for passing large amount data between server and other applications due to query protocol not being designed to handle it.

Fields

static NOT_FOUND_VALUE

  • Description: Represents a null value. Changing this field is not a valid use of this field and may result in undefined behavior.

Functions

getQueryData()

  • Description: Get query data array
  • Return: Array with data from query

addToQuery(name)

  • Description: Add entry into query. The value is QueryAPI::$NOT_FOUND_VALUE
  • Return: None
  • Arguments:
    • mixed name - name of the entry. Must be a valid array key. It is recommended to use string as a name for entry
  • Examples:
    $this->addToQuery("plugins");
    $this->addToQuery("map");
    $this->addToQuery("numplayers");
    
    Source: QueryAPI::__construct, NostalgiaCore

updateQueryData(name, value)

  • Description: Add new entry or modify exisiting entry
  • Return: None
  • Arguments:
    • mixed name - name of the entry. Must be a valid array key. It is recommended to use string as a name for entry
    • mixed value - value. Must be a valid right-side value for PHP concatenation operator
  • Examples:
    $this->updateQueryData("game_id", "MINECRAFTPE");
    
    Source: QueryAPI::__construct, NostalgiaCore

Clone this wiki locally