Skip to content

LootStack 5.46.0 ​

final class · pocketmine\loot\LootStack · source

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 ​

php
public int $count

$customName ​

php
public ?string $customName

Custom name (plain text).

$damage ​

php
public int $damage

Damage value (Java "damage" component), only meaningful for damageable items.

$enchantments ​

php
public array $enchantments

Java enchantment id => level. For enchanted books these are the stored enchantments.

$id ​

php
public string $id

Java item id, e.g. "minecraft:iron_ingot"; "minecraft:air" is the empty stack

$instrument ​

php
public ?string $instrument

Java instrument id of goat horns ("minecraft:ponder_goat_horn").

$ominousAmplifier ​

php
public ?int $ominousAmplifier

Ominous bottle amplifier (0-4).

$potion ​

php
public ?string $potion

Java potion id ("minecraft:healing") of potions, splash/lingering potions and tipped arrows.

$stewEffects ​

php
public array $stewEffects

Suspicious stew effects: list of [Java effect id, duration in ticks].

$trim ​

php
public ?array $trim

Armor trim: [Java trim material id, Java trim pattern id].

Methods ​

__construct() ​

php
public function __construct(string $id, int $count = 1)

copyWithCount() ​

php
public function copyWithCount(int $count) : self

ItemStack.copyWithCount()

describe() ​

php
public function describe() : string

A compact description in Java terms, e.g. "minecraft:enchanted_book x1 {minecraft:sharpness=3}", for logs and comparisons with Java Edition.

empty() ​

php
public static function empty() : self

enchant() ​

php
public function enchant(string $enchantment, int $level) : void

Adds an enchantment, keeping the higher level if it is already there (ItemEnchantments.Mutable.upgrade()).

getEnchantmentLevel() ​

php
public function getEnchantmentLevel(string $enchantment) : int

isEmpty() ​

php
public function isEmpty() : bool

split() ​

php
public function split(int $amount) : self

ItemStack.split()

transmute() ​

php
public function transmute(string $id) : self

ItemStack.transmuteCopy(): the same components on another item.

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