RaiderLoot 5.47.0
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.65BONUS_CHANCE_HARD
php
public const BONUS_CHANCE_HARD = 0.8Methods
getBonusChance()
php
public static function getBonusChance(int $difficulty) : floatChance of the bonus roll in this difficulty.
roll()
php
public static function roll(int $difficulty, int $lootingLevel, float $specialMultiplier) : arrayRolls the raider drops. Randomness comes from mt_rand(), so that seeded tests are reproducible.
