Skip to content

StringToTParser ​

abstract class · pocketmine\utils\StringToTParser · source

Handles parsing any Minecraft thing from strings. This can be used, for example, to implement a user-friendly item parser to be used by the /give command (and others). Custom aliases may be registered. Note that the aliases should be user-friendly, i.e. easily readable and writable.

Methods ​

getKnownAliases() ​

php
public function getKnownAliases() : array

override() ​

php
public function override(string $alias, \Closure $callback) : void

parse() ​

php
public function parse(string $input)

Tries to parse the specified string into a corresponding instance of T.

register() ​

php
public function register(string $alias, \Closure $callback) : void

registerAlias() ​

php
public function registerAlias(string $existing, string $alias) : void

Registers a new alias for an existing known alias.

reprocess() protected ​

php
protected function reprocess(string $input) : string

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.