Lot of traits!

This commit is contained in:
Robert Sosnitzka
2016-07-14 15:12:52 +02:00
parent b11e69af7c
commit a13131adc9
11 changed files with 116 additions and 49 deletions

View File

@@ -39,15 +39,15 @@ public class TraitGlimmer extends AbstractTrait {
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
if (random.nextFloat() <= 0.02) {
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 300));
if (random.nextFloat() <= 0.05) {
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, random.nextInt(600) + 300));
}
}
@Override
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
if (random.nextFloat() <= 0.05) {
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 300));
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, random.nextInt(600) + 300));
}
}
}