for(EntityPlayer player : players) { player.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, summoner), 10); player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 25, 0)); PotionEffect wither = new PotionEffect(MobEffects.WITHER, 120, 2); wither.getCurativeItems().clear(); player.addPotionEffect(wither);
if(currentEffect == null || currentEffect.getDuration() < (nightVision ? 205 : 3)) { PotionEffect applyEffect = new PotionEffect(effect.getPotion(), nightVision ? 285 : 80, effect.getAmplifier(), true, true); player.addPotionEffect(applyEffect);
@Override public void onAvatarUpdate(IAvatarTile tile, ItemStack stack) { TileEntity te = (TileEntity) tile; World world = te.getWorld(); if(tile.getCurrentMana() >= COST && tile.isEnabled()) { int range = 5; int rangeY = 3; List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(te.getPos().add(-0.5 - range, -0.5 - rangeY, -0.5 - range), te.getPos().add(0.5 + range, 0.5 + rangeY, 0.5 + range))); for(EntityPlayer p : players) { if(p.motionY > 0.3 && p.motionY < 2 && !p.isSneaking()) { p.motionY = 2.8; for(int i = 0; i < 20; i++) for(int j = 0; j < 5; j++) Botania.proxy.wispFX(p.posX, p.posY + i, p.posZ, 0.25F, 0.25F, 0.25F, 0.35F + (float) Math.random() * 0.1F, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); if(!world.isRemote) { p.world.playSound(null, p.posX, p.posY, p.posZ, ModSounds.dash, SoundCategory.PLAYERS, 1F, 1F); p.addPotionEffect(new PotionEffect(ModPotions.featherfeet, 100, 0)); tile.recieveMana(-COST); } } } } }
@Override public void onUpdate() { super.onUpdate(); if(!supertile.getWorld().isRemote && supertile.getWorld().provider.getDimension() != 1) { boolean did = false; List<EntityPlayer> players = supertile.getWorld().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); for(EntityPlayer player : players) { if(player.getActivePotionEffect(MobEffects.REGENERATION) == null && mana >= COST) { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 59, 2, true, true)); mana -= COST; did = true; } } if(did) sync(); } }
@Override public boolean onActivate(IImperfectRitualStone imperfectRitualStone, EntityPlayer player) { player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 1200, 1)); return true; } }
@Override public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) { if (changeMap.containsKey(livingArmour) && changeMap.get(livingArmour)) { changeMap.put(livingArmour, false); if (digSpeedTime[this.level] > 0) { player.addPotionEffect(new PotionEffect(MobEffects.SPEED, digSpeedTime[this.level], digSpeedLevel[this.level], false, false)); } } }
@Override public void onEaten(ItemStack itemStack, EntityPlayer player) { if (!player.world.isRemote) { for(RandomPotionEffect potionEffect : potionEffects) { if (Math.random() * 100 > potionEffect.chance) { player.addPotionEffect(GTUtility.copyPotionEffect(potionEffect.effect)); } } } }
@Override public void setInstantConfusionOnPlayer(@Nonnull EntityPlayer ent, int duration) { ent.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, duration, 1, true, true)); Minecraft.getMinecraft().player.timeInPortal = 1; }
private static void updateNightvision(EntityPlayer player) { if (isNightVisionUpgradeEquipped(player) && DATA.get().nightVisionActive) { player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 210, 0, true, true)); } if (!isNightVisionUpgradeEquipped(player) && DATA.get().nightVisionActive) { DATA.get().nightVisionActive = false; DATA.get().removeNightvision = true; } if (DATA.get().removeNightvision) { player.removePotionEffect(MobEffects.NIGHT_VISION); DATA.get().removeNightvision = false; } }
@Override public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected) { if (PlayerHelper.isFakePlayer(player)) return; player.addPotionEffect(new PotionEffect(MobEffects.HASTE, 2, 0, true, false)); }
@Override public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected) { if (PlayerHelper.isFakePlayer(player)) return; player.addPotionEffect(new PotionEffect(RegistrarBloodMagic.CLING, 2, 0, true, false)); } }
@Override public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected) { if (PlayerHelper.isFakePlayer(player)) return; player.addPotionEffect(new PotionEffect(RegistrarBloodMagic.BOOST, 2, 0, true, false)); } }
@Override public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected) { if (PlayerHelper.isFakePlayer(player)) return; player.fallDistance = 0; player.extinguish(); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 2, 1, true, false)); player.addPotionEffect(new PotionEffect(MobEffects.WATER_BREATHING, 2, 0, true, false)); } }
@Override public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected) { if (PlayerHelper.isFakePlayer(player)) return; player.addPotionEffect(new PotionEffect(RegistrarBloodMagic.BOUNCE, 2, 0, true, false)); } }
@Override public void onSigilUpdate(ItemStack stack, World world, EntityPlayer player, int itemSlot, boolean isSelected) { if (PlayerHelper.isFakePlayer(player)) return; player.addPotionEffect(new PotionEffect(RegistrarBloodMagic.WHIRLWIND, 2, 0, true, false)); } }
public void addEffects(EntityPlayer player, T type) { if (player.world.rand.nextFloat() < type.getPoisonChance() && SyncedConfig.getBooleanValue(GameplayOption.ENABLE_THIRST)) { player.addPotionEffect(new PotionEffect(TANPotions.thirst, 600)); } }
@SubscribeEvent public static void onPlayerRespawn(PlayerEvent.Clone event) { if (event.isWasDeath()) event.getEntityPlayer().addPotionEffect(new PotionEffect(RegistrarBloodMagic.SOUL_FRAY, 400)); }
@Override public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) { if (player.isBurning() && fireCooldown <= 0) { player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, fireResistDuration[this.level])); fireCooldown = fireCooldownTime[this.level]; player.sendStatusMessage(new TextComponentString(TextHelper.localizeEffect(chatBase + "fireRemove")), true); } else if (fireCooldown > 0) { fireCooldown--; } }
@Override public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) { counter++; if (world.canSeeSky(player.getPosition()) || world.provider.isDaytime()) { if (counter % regenCooldown[this.level] == 0 && player.getHealth() < player.getMaxHealth()) { player.heal(1); } if (fireResistTime[this.level] != 0 && counter % fireResistCooldown[this.level] == 0) { player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, fireResistTime[this.level], 0, false, false)); } } }
@SubscribeEvent public void onHurt(LivingHurtEvent event) { Entity e = event.getEntity(); if(e instanceof EntitySquid && !e.world.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) { List<EntityPlayer> players = e.world.getEntitiesWithinAABB(EntityPlayer.class, e.getEntityBoundingBox().grow(4, 4, 4)); for(EntityPlayer player : players) player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, time, 0)); WorldServer ws = (WorldServer) e.world; ws.spawnParticle(EnumParticleTypes.SMOKE_LARGE, e.posX + e.width / 2, e.posY + e.height / 2, e.posZ + e.width / 2, 100, 0, 0, 0, 0.02); } }