Skip to content

Function List

Glitchmaster_PE edited this page Nov 5, 2013 · 19 revisions

This list is most likely incomplete and additions to it are appreciated and encouraged.

If you want to use these, use them in the format:

$this -> api -> [THE_DESIRED_API] -> [FUNCTION_NAME]([PARAMETERS]);

For Example:

$this->api->chat->broadcast("FUNCTION LIST!!!");

Function List:

What API: Name: Parameters:
Ban cmdWhitelist $cmd
Ban isOp $username
Ban permissionsCheck $data, $event
Ban ban $username
Ban pardon $username
Ban banIP $ip
Ban pardonIP $ip
Ban kick $username, $reason (default is: "No Reason")
Ban reload None
Ban isIPBanned $ip
Ban isBanned $username
Ban inWhitelist $username
Block playerBlockBreak Player $player, Vector3 $vector
Block playerBlockAction Player $player, Vector3 $vector, $face, $fx, $fy, $fx
Block blockUpdateAround Position $pos, $type (default: "BLOCK_UPDATE_NORMAL"), $delay (default: "false")
Block blockUpdate Position $pos, $type (default: "BLOCK_UPDATE_NORMAL")
Block scheduleBlockUpdate Position $pos, $delay, $type (default: "BLOCK_UPDATE_SCHEDULED")
Block nextRandomUpdate Position $pos
Block blockUpdateTick None
Chat broadcast $message
Chat sendTo $owner, $text, $player
Chat send $owner, $text, $whitelist (default: "false"), $blacklist (default: "false")
Console alias $alias, $cmd
Console register $cmd, $help, $callback
Console run $line (default: ""), $issuer (default: "console"), $alias (default: "false")
Entity get $eid
Entity updateEntities None
Entity updateRadius Position $center, $radius (default: 15), $class (default: "false")
Entity getRadius Position $center, $radius (default: 15), $class (default: "false")
Entity getAll $level (default: "null")
Entity heal $eid, $heal (default: 1), $cause
Entity harm $eid, $attack (default: 1), $cause, $force (default: "false")
Entity add Level $level, $class, $type (default: 0), $data (default: array())
Entity spawnToAll Entity $e
Entity drop Position $pos, Item $item
Entity spawnAll Player $player
Entity remove $eid
Level get $name
Level getDefault None
Level generateLevel $name, $seed (default: "false"), $generator (default: "false")
Level levelExists $name
Level unloadLevel Level $level, $force (default: "false"
Level loadLevel $name
Level saveAll None
Level getSpawn None
Level loadMap None
Player teleport &$name, &$target
Player tppos &$name, &$x, &$y, &$z
Player get $name, $alike (default: "true")
Player getAll $level (default: "null")
Player broadcastPacket array $players, $id, $data (default: array())
Player getByEID $eid
Player online None
Player add $CID
Player spawnAllPlayers Player $player
Player spawnToAllPlayers Player $player
Player remove $CID
Player getOffline $name
Player saveOffline Config $data
Plugin getList None
Plugin getInfo $className
Plugin load $file
Plugin get Plugin $plugin
Plugin configPath Plugin $plugin
Plugin createConfig Plugin $plugin, $default (default: array())
Plugin readYAML $file
Plugin writeYAML $file, $data
Server start None
Server run None
Server load None
Server async callable $callable, $params (default: array()), $remove (default: "false")
Server getAsync $id
Server autoSave None
Server sendUsage None
Server asyncOperation $t, $d, $c (default: "null")
Server addHandler $e, $c, $p (default: 5)
Server dhandle $e, $d
Server handle $e, &$d
Server schedule $t, $c, $d, $r (default: "false", $e (default: server.schedule)
Server event $e, $d
Server trigger $e, $d
Server deleteEvent $id
Server getProperties None
Server getProperty $name, $default (default: "false")
Server setProperty $name, $value
Server getList None
Server loadAPI $name, $class, $dir (default: "false")
Tile get Position $pos
Tile getByID $id
Tile getAll $level (default: "null")
Tile add Level $level, $class, $x, $y, $z, $data (default: array())
Tile addSign Level $level, $x, $y, $z, $lines (default: array("", "", "", ""))
Tile spawnToAll Tile $t
Tile spawnAll Player $player
Tile remove $id
Time night None
Time day None
Time sunrise None
Time sunset None
Time get $raw (default: "false"), $level (default: "false")
Time add $time, $level (default: "false")
Time getDate $time (default: "false")
Time getPhase $time (default: "false")
Time set $time, $level (default: "false")
Please let me know if this list is incomplete!

#Ban API:

####cmdWhitelist($cmd) $cmd = The desired whitelisted command

Allows you to make a command available to all users not just OP users

Example:

$this->api->ban->cmdWhitelist("defaultCommand");

####isOP($username) $username = The user name of the user you wish to check

Allows you to see and change the results of an event if a user is OP or not

Example:

$this->api->ban->isOP("Default_User");

####permissionCheck($data, $event) No current info on function

####ban($username) $username = The user name of the player you wish to ban

Allows you to ban a player with this function

Example:

$this->api->ban->ban("Default_User");

####pardon($username) $username = The user name of the player you wish to remove from the ban list

Allows you to remove a player from the ban list

Example:

$this->api->ban->pardon("Default_User");

####banIP($ip) $ip = The IP address of the IP you want to ban

Allows you to ban an IP

Example:

$this->api->ban->banIP(01.234.567.89);

####pardonIP($ip) $ip = The IP address you wish to pardon

Allows you to un-ban an IP

Example:

$this->api->ban->pardonIP(01.234.567.89);

####kick($user, $reason) $user = The username of the player you wish to kick

$reason = Why you want to kick him (default: "No Reason")

Allows you to kick a player

Example:

$this->api->ban->kick("Default_User","Do not swear!");

####reload(accepts no parameters) Allows you to reload the ban, banip, and whitelist list

Example:

$this->api->ban->reload();

####isIPBanned($ip) $ip = The IP you wish to check

Allows you to check if an IP is banned

Example:

$this->api->ban->isIPBanned(01.234.567.89);

####isBanned($username) $username = The username you wish to check

Allows you to check if a user is banned

Example:

$this->api->ban->isBanned("Default_User");

####inWhitelist($username) $username = The username you wish to check

Allows you to check if a user is on the whitelist

Example:

$this->api->ban->inWhitelist("Default_User");

#Block API

#Chat API

####broadcast($message) $message = The desired message that will be broadcast through out the server

Allows you to send a message to every player on the server

Example:

$this->api->chat->broadcast("Hi, How are you?");

####sendTo($owner, $message, $player) $owner = Not quite sure about this, just put "false"

$message = The desired message you wish to send to one user

$player = The player you wish to send the message to

Allows you to send a message to one player

Example:

$this->api->chat->sendTo(false, "Hi, How are you?", "Default_Player");

####send($owner, $text, $whitelist, $blacklist) $owner = NA

$text = NA

$whitelist = NA

$blacklist = NA

Not sure of the function of the function

#Console API

####alias($alias, $cmd) $alias = What you want the command to be aliased as

$cmd = The command you want to alias

Allows you to call a command by another name

Example:

$this->api->console->alias("dc","Default_Command");

####register($cmd, $help, $callback) $cmd = The command you wish to register

$help = The description of the command you wish to register

$callback = What you want to call the as in the public function. Format: array($this, "CallBack")

Allows you to register a command

Example:

$this->api->console->register("Default_Command","This is a default command",array($this, "CallBack");

You would call it like this:

public function CallBack($cmd){

}

####run($line, $issuer, $alias)

$line = What you want to run

$issuer = Who you want to run the command, default: Console

$alias = Not sure, just leave it blank

This allows you to run a command

Example:

$this->api->console->run("say Hi");

Another Example:

$this->api->console->run("/say Hi","Default_User");

#Entity API

#Level API

#Player API

####teleport($name, $target) $name = The user you wish to teleport

$target = The user you wish to teleport to

Allows you to teleport a user to another user

Example:

$this->api->player->teleport("Default_Player","Default_Player_2");

####tppos($name, $x, $y, $z) $name = The user you wish to teleport

$x = The X coordinate that you wish to teleport to

$y = The Y coordinate that you wish to teleport to

$z = The Z coordinate that you wish to teleport to

Allows you to teleport a user to a certain X, Y, and Z

Example:

$this->api->player->tppos("Default_Player","100","100","100");

####get($name,$alike) I am not sure of this functions properties

####getAll($level) $level = The level you wish to get the players on default: null

Allows you to get all the players on a level

Example:

$this->api->player->getAll();

####broadcastPacket(array $players, $id, $data) Not sure of this function's purpose

####getByID($eid) Not sure of this function's purpose

####online(Accepts no parameters) Gets an array of the online players

Example:

$this->api->player->online();

####add($CID) Not sure of the purpose function

####spawnAllPlayers(Player $player) Not sure of the purpose of the function

####spawnToAllPlayers(Player $player) Not sure of the purpose of this function

####remove($CID) Not sure of the purpose of this function

####getOffline($name) $name = The player's name

Gets the info about an offline player which is stored in the players folder

Example:

$this->api->player->getOffline("Default_Player");

####saveOffline(Config $data) $data = The data you wish to save

Save info if you changed something about an offline player using the getOffline function

Example:

$this->api->player->saveOffline(Config $data["Player"]["Inventory"]);

#Plugin API

####getList(Accepts no parameters) Gets a list of all the plugins you have loaded

Example:

$this->api->plugin->getList();

####getInfo($className) $className = The class of the plugin

Let's you get info on a certain plugin by its class

Example:

$this->api->plugin->getInfo("Default_Class");

####load($file) $file = The file you want to load

Let's you load a plugin remotely

Example:

$this->api->plugin->load("default_plugin.php");

####get(Plugin $plugin) Not sure of the purpose of this function

####configPath(Plugin $plugin) $plugin = The path you want

This selects where your config file go, I suggest just using $this

Example:

$this->api->plugin->configPath($this);

####createConfig(Plugin $plugin, $default) $plugin = The name of the new config

$default = Default: array()

Creates a new Config

Example:

$this->api->plugin->createConfig(Plugin "Default_Config.yml");

####fillDefaults($default, $yaml) Not sure of the purpose of this function

####readYAML($file) $file = The YAML path

Makes the plugin read changes to the YAML

Example:

$this->api->plugin->readYAML("Default_Config.yml");

####writeYAML($file) $file = The file you wish to write

Let's you write on a YAML file, be careful, because this overwrites the whole config not just adds a part to the file

Example:

$this->api->plugin->writeYAML("$this->path . "Default_Config.yml","Overwrite with this line");

#Server API

#Tile API

#Time Api

Clone this wiki locally