FortuneDropHelper
Methods
binomial()
public static function binomial(\pocketmine\item\Item $usedItem, int $min, int $minRolls = 3, float $chance = 4 / 7) : intIncreases the drop amount according to a binomial distribution. The function will roll maxBase+level times, and add 1 if a random number between 0-1 is less than the given probability. Each level of fortune adds one extra roll.
As many as maxBase+level items can be dropped. This applies even if the fortune level is 0.
bonusChanceDivisor()
public static function bonusChanceDivisor(\pocketmine\item\Item $usedItem, int $divisorBase, int $divisorSubtractPerLevel) : boolCalculates a chance of getting an extra bonus drop by reducing the chance divisor by a given amount per fortune level.
bonusChanceFixed()
public static function bonusChanceFixed(\pocketmine\item\Item $usedItem, float $chanceBase, float $addedChancePerLevel) : boolCalculates a chance of getting an extra bonus drop by increasing the chance by a fixed amount per fortune level.
discrete()
public static function discrete(\pocketmine\item\Item $usedItem, int $min, int $maxBase) : intAdds the fortune level to the base max and picks a random number between the minimim and adjusted maximum. Each amount in the range has an equal chance of being picked.
weighted()
public static function weighted(\pocketmine\item\Item $usedItem, int $min, int $maxBase) : intIf a random number between 0-1 is greater than 2/(level+2), this multiplies the max drop amount by level+1, and picks a random amount between the minimum and multiplied maximum. Each level of fortune increases the chance of fortune activation, and also increases the maximum drop limit when activated.
Otherwise, returns a random amount of the item between the minimum and original maximum.
