Skip to content

LootEntry 5.46.0 ​

final class · pocketmine\loot\LootEntry · source

A loot pool entry (vanilla's LootPoolEntryContainer). Singleton entries (item, tag, loot_table, dynamic, empty) expand to themselves (an expanded tag expands to one choice per item); composite entries (alternatives, group, sequence) expand their children.

Constants ​

ALTERNATIVES ​

php
public const ALTERNATIVES = 5

DYNAMIC ​

php
public const DYNAMIC = 3

EMPTY ​

php
public const EMPTY = 4

GROUP ​

php
public const GROUP = 6

ITEM ​

php
public const ITEM = 0

SEQUENCE ​

php
public const SEQUENCE = 7

TABLE ​

php
public const TABLE = 2

TAG ​

php
public const TAG = 1

Properties ​

$children ​

php
public array $children

$expand ​

php
public bool $expand

$name ​

php
public string $name

$quality ​

php
public readonly int $quality

$tableProvider ​

php
public ?\Closure $tableProvider

$tagItems ​

php
public array $tagItems

$type ​

php
public readonly int $type

$weight ​

php
public readonly int $weight

Methods ​

__construct() ​

php
public function __construct(int $type, int $weight, int $quality, ?\Closure $condition, ?\Closure $function, string $name)

createItemStack() ​

php
public function createItemStack(?string $tagItem, \Closure $output, \pocketmine\loot\LootContext $context) : void

LootPoolEntry.createItemStack(), for a choice returned by expand().

expand() ​

php
public function expand(\pocketmine\loot\LootContext $context, \Closure $output) : bool

LootPoolEntryContainer.expand(): passes the choices of this entry to $output ([entry, item of an expanded tag]).

getWeight() ​

php
public function getWeight(float $luck) : int

LootPoolEntry.getWeight()

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