Adds a dice roll to absorbing a curse.
This commit is contained in:
parent
600b3c686a
commit
a8dd0954f0
1 changed files with 3 additions and 1 deletions
|
@ -137,7 +137,9 @@ public class ConsumptionMending extends Enchantment
|
||||||
for(Map.Entry<Enchantment,Integer> entry : enchantments.entrySet())
|
for(Map.Entry<Enchantment,Integer> entry : enchantments.entrySet())
|
||||||
{
|
{
|
||||||
Enchantment id = entry.getKey();
|
Enchantment id = entry.getKey();
|
||||||
if(id.isCurse())
|
int dice = player.getRandom().nextInt(0,20);
|
||||||
|
|
||||||
|
if(id.isCurse() && ((dice >= 13) && (dice <= 18)))
|
||||||
{
|
{
|
||||||
stack.enchant(id, entry.getValue());
|
stack.enchant(id, entry.getValue());
|
||||||
player.getLevel().playSound(null, player.getOnPos(), SoundEvents.ANVIL_USE, SoundSource.NEUTRAL,1, player.getRandom().nextFloat(0,1));
|
player.getLevel().playSound(null, player.getOnPos(), SoundEvents.ANVIL_USE, SoundSource.NEUTRAL,1, player.getRandom().nextFloat(0,1));
|
||||||
|
|
Reference in a new issue