use of net.minecraft.potion.PotionEffect in project Wizardry by TeamWizardry.
the class PotionLowGrav method fall.
@SubscribeEvent
public void fall(LivingFallEvent event) {
EntityLivingBase entity = event.getEntityLiving();
if (!entity.isPotionActive(this))
return;
PotionEffect effect = entity.getActivePotionEffect(this);
if (effect == null)
return;
event.setDistance((float) (event.getDistance() / (effect.getAmplifier() + 0.5)));
}
use of net.minecraft.potion.PotionEffect in project BaseMetals by MinecraftModDevelopmentMods.
the class MMDToolEffects method applyEffectsForStarsteel.
private static void applyEffectsForStarsteel(final EntityPlayer player) {
if (!starsteelUpdateCache.containsKey(player)) {
return;
}
final int num = starsteelUpdateCache.get(player).getAndSet(0);
if (num == 0) {
return;
}
final PotionEffect jumpBoost = new PotionEffect(MobEffects.JUMP_BOOST, EFFECT_DURATION, num - 1, false, false);
player.addPotionEffect(jumpBoost);
if (num > 1) {
final PotionEffect speedBoost = new PotionEffect(MobEffects.SPEED, EFFECT_DURATION, num - 2, false, false);
player.addPotionEffect(speedBoost);
}
}
use of net.minecraft.potion.PotionEffect in project BaseMetals by MinecraftModDevelopmentMods.
the class MMDToolEffects method applyEffectsForColdiron.
private static void applyEffectsForColdiron(final EntityPlayer player) {
if (hasFullSuit(player, MaterialNames.COLDIRON)) {
final PotionEffect fireProtection = new PotionEffect(MobEffects.FIRE_RESISTANCE, EFFECT_DURATION, 0, false, false);
player.addPotionEffect(fireProtection);
}
}
use of net.minecraft.potion.PotionEffect in project Wizardry by TeamWizardry.
the class ModuleEffectCrasherFall method run.
@Override
public boolean run(@Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
Entity targetEntity = spell.getVictim();
if (targetEntity instanceof EntityLivingBase) {
double strength = spellRing.getAttributeValue(AttributeRegistry.POTENCY, spell);
double duration = spellRing.getAttributeValue(AttributeRegistry.DURATION, spell) * 10;
if (!spellRing.taxCaster(spell))
return false;
((EntityLivingBase) targetEntity).addPotionEffect(new PotionEffect(ModPotions.CRASH, (int) duration, (int) strength, true, true));
}
return true;
}
use of net.minecraft.potion.PotionEffect in project Wizardry by TeamWizardry.
the class ModuleEffectLowGravity method run.
@Override
@SuppressWarnings("unused")
public boolean run(@Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
World world = spell.world;
Entity targetEntity = spell.getVictim();
BlockPos targetPos = spell.getTargetPos();
Entity caster = spell.getCaster();
double potency = spellRing.getAttributeValue(AttributeRegistry.POTENCY, spell);
double time = spellRing.getAttributeValue(AttributeRegistry.DURATION, spell);
if (!spellRing.taxCaster(spell))
return false;
if (targetEntity != null) {
spell.world.playSound(null, targetEntity.getPosition(), ModSounds.TELEPORT, SoundCategory.NEUTRAL, 1, 1);
((EntityLivingBase) targetEntity).addPotionEffect(new PotionEffect(ModPotions.LOW_GRAVITY, (int) time, (int) potency, true, false));
}
return true;
}
Aggregations