LootStack 5.46.0
An item stack produced by a loot table, in Java Edition terms (the loot table data is Java's): a Java item id, a count and the components the loot functions set. LootItemConverter turns it into a PocketMine item.
Properties
$count
public int $count$customName
public ?string $customNameCustom name (plain text).
$damage
public int $damageDamage value (Java "damage" component), only meaningful for damageable items.
$enchantments
public array $enchantmentsJava enchantment id => level. For enchanted books these are the stored enchantments.
$id
public string $idJava item id, e.g. "minecraft:iron_ingot"; "minecraft:air" is the empty stack
$instrument
public ?string $instrumentJava instrument id of goat horns ("minecraft:ponder_goat_horn").
$ominousAmplifier
public ?int $ominousAmplifierOminous bottle amplifier (0-4).
$potion
public ?string $potionJava potion id ("minecraft:healing") of potions, splash/lingering potions and tipped arrows.
$stewEffects
public array $stewEffectsSuspicious stew effects: list of [Java effect id, duration in ticks].
$trim
public ?array $trimArmor trim: [Java trim material id, Java trim pattern id].
Methods
__construct()
public function __construct(string $id, int $count = 1)copyWithCount()
public function copyWithCount(int $count) : selfItemStack.copyWithCount()
describe()
public function describe() : stringA compact description in Java terms, e.g. "minecraft:enchanted_book x1 {minecraft:sharpness=3}", for logs and comparisons with Java Edition.
empty()
public static function empty() : selfenchant()
public function enchant(string $enchantment, int $level) : voidAdds an enchantment, keeping the higher level if it is already there (ItemEnchantments.Mutable.upgrade()).
getEnchantmentLevel()
public function getEnchantmentLevel(string $enchantment) : intisEmpty()
public function isEmpty() : boolsplit()
public function split(int $amount) : selfItemStack.split()
transmute()
public function transmute(string $id) : selfItemStack.transmuteCopy(): the same components on another item.
