Skip to content

RaiderLoot 5.47.0 ​

final class · pocketmine\world\raid\RaiderLoot · source

The extra loot of pillagers and vindicators spawned by a raid (Bedrock raid_configuration: pillager_raid.json and vindicator_raid.json are the mob's own table plus raider_drops.json):

  • 0-1 emerald (+0-1 per Looting level), whoever killed it;
  • then, with a chance of 65% (80% on Hard, never on Peaceful), one of: 0-1 emerald (weight 40), 2-3 emeralds (20), 4-5 emeralds (8; each +0-1 per Looting level), a book enchanted with 30 levels (8), or an iron pickaxe, axe, shovel, sword, helmet, chestplate, leggings or boots (10 each) with 30-90% of its durability left and enchanted like mob gear (enchant_random_gear chance 0.5, scaled by the regional difficulty like the spawn equipment).

Simplification: the book never gets treasure enchantments (Mending, Frost Walker...), like fishing treasure books.

Constants ​

BONUS_CHANCE ​

php
public const BONUS_CHANCE = 0.65

BONUS_CHANCE_HARD ​

php
public const BONUS_CHANCE_HARD = 0.8

Methods ​

getBonusChance() ​

php
public static function getBonusChance(int $difficulty) : float

Chance of the bonus roll in this difficulty.

roll() ​

php
public static function roll(int $difficulty, int $lootingLevel, float $specialMultiplier) : array

Rolls the raider drops. Randomness comes from mt_rand(), so that seeded tests are reproducible.

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.