StringToTParser
in package
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.
Tags
Table of Contents
- $callbackMap : array<string|int, mixed>
- getKnownAliases() : array<string|int, string>|array<string|int, int>
- override() : void
- parse() : mixed
- Tries to parse the specified string into an enchantment.
- register() : void
- reprocess() : string
Properties
$callbackMap
private
array<string|int, mixed>
$callbackMap
= []
Tags
Methods
getKnownAliases()
public
getKnownAliases() : array<string|int, string>|array<string|int, int>
Return values
array<string|int, string>|array<string|int, int> —override()
public
override(string $alias, Closure $callback) : void
Parameters
- $alias : string
- $callback : Closure
Tags
Return values
void —parse()
Tries to parse the specified string into an enchantment.
public
parse(string $input) : mixed
Parameters
- $input : string
Tags
Return values
mixed —register()
public
register(string $alias, Closure $callback) : void
Parameters
- $alias : string
- $callback : Closure
Tags
Return values
void —reprocess()
protected
reprocess(string $input) : string
Parameters
- $input : string