use of com.minecolonies.api.entity.ICustomAttackSound in project minecolonies by ldtteam.
the class RaiderRangedAI method doAttack.
@Override
protected void doAttack(final LivingEntity target) {
user.getNavigation().stop();
// Setup arrow
AbstractArrowEntity arrowEntity = CombatUtils.createArrowForShooter(user);
arrowEntity.setBaseDamage(user.getAttribute(MOB_ATTACK_DAMAGE).getValue());
if (flightCounter > 5) {
((CustomArrowEntity) arrowEntity).setPlayerArmorPierce();
arrowEntity.setSecondsOnFire(200);
arrowEntity.setBaseDamage(10);
}
if (user.getDifficulty() > ARROW_PIERCE_DIFFICULTY) {
arrowEntity.setPierceLevel((byte) 2);
}
// Shoot arrow
CombatUtils.shootArrow(arrowEntity, target, 10.0f);
// Visuals
user.swing(Hand.MAIN_HAND);
SoundEvent attackSound = SoundEvents.SKELETON_SHOOT;
if (arrowEntity instanceof ICustomAttackSound) {
attackSound = ((ICustomAttackSound) arrowEntity).getAttackSound();
}
user.playSound(attackSound, (float) 1.0D, (float) getRandomPitch());
}
use of com.minecolonies.api.entity.ICustomAttackSound in project minecolonies by Minecolonies.
the class RaiderRangedAI method doAttack.
@Override
protected void doAttack(final LivingEntity target) {
user.getNavigation().stop();
// Setup arrow
AbstractArrowEntity arrowEntity = CombatUtils.createArrowForShooter(user);
arrowEntity.setBaseDamage(user.getAttribute(MOB_ATTACK_DAMAGE).getValue());
if (flightCounter > 5) {
((CustomArrowEntity) arrowEntity).setPlayerArmorPierce();
arrowEntity.setSecondsOnFire(200);
arrowEntity.setBaseDamage(10);
}
if (user.getDifficulty() > ARROW_PIERCE_DIFFICULTY) {
arrowEntity.setPierceLevel((byte) 2);
}
// Shoot arrow
CombatUtils.shootArrow(arrowEntity, target, 10.0f);
// Visuals
user.swing(Hand.MAIN_HAND);
SoundEvent attackSound = SoundEvents.SKELETON_SHOOT;
if (arrowEntity instanceof ICustomAttackSound) {
attackSound = ((ICustomAttackSound) arrowEntity).getAttackSound();
}
user.playSound(attackSound, (float) 1.0D, (float) getRandomPitch());
}
Aggregations