use of com.miningmark48.pearcelmod.entity.EntityPearcelBoss in project Pearcel-Mod by MiningMark48.
the class ItemGuardianFood method onFoodEaten.
@Override
protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) {
BlockPos pos = player.getPosition();
int x = pos.getX();
int y = pos.getY();
int z = pos.getZ();
Random rand = new Random();
int num = rand.nextInt(5) + 10;
int range = 25;
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range));
if (!world.isRemote) {
EntityPearcelBoss pb = new EntityPearcelBoss(world);
pb.setPosition(x, y + num, z);
world.spawnEntity(new EntityLightningBolt(world, x, y, z, true));
world.spawnEntity(pb);
for (EntityPlayer e : players) {
e.sendMessage(new TextComponentString(TextFormatting.GREEN + Translate.toLocal("chat.item.guardian_food.summoned")));
}
}
world.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, x + 0.5, y + num + 0.5, z + 0.5, 1.0D, 0.0D, 0.0D);
for (EntityPlayer e : players) {
e.playSound(ModSoundEvents.MOB_PEARCEL_BOSS_LAUGH, 5.0F, 1.0F);
}
}
use of com.miningmark48.pearcelmod.entity.EntityPearcelBoss in project Pearcel-Mod by MiningMark48.
the class ItemPearcelStaff method hitEntity.
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase hitEntity, EntityLivingBase attackEntity) {
if (hitEntity instanceof EntityPearcelBoss) {
return false;
} else {
hitEntity.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 2000, 2, true, false));
hitEntity.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 5000, 2, true, false));
return true;
}
}
Aggregations