use of net.minecraft.entity.projectile.WitherSkullEntity in project Enigmatic-Legacy by Aizistral-Studios.
the class AngelBlessing method redirect.
public void redirect(LivingEntity bearer, Entity redirected) {
if (redirected instanceof UltimateWitherSkullEntity || redirected instanceof WitherSkullEntity)
return;
/*if (redirected instanceof TridentEntity)
if (((TridentEntity)redirected).getShooter() == bearer)
return;*/
Vector3 entityPos = Vector3.fromEntityCenter(redirected);
Vector3 bearerPos = Vector3.fromEntityCenter(bearer);
Vector3 redirection = entityPos.subtract(bearerPos);
redirection = redirection.normalize();
if (redirected instanceof AbstractArrowEntity && ((AbstractArrowEntity) redirected).getShooter() == bearer) {
if (redirected instanceof TridentEntity) {
TridentEntity trident = (TridentEntity) redirected;
if (trident.returningTicks > 0)
return;
}
redirected.setMotion(redirected.getMotion().x * 1.75D, redirected.getMotion().y * 1.75D, redirected.getMotion().z * 1.75D);
} else
redirected.setMotion(redirection.x, redirection.y, redirection.z);
if (redirected instanceof DamagingProjectileEntity) {
DamagingProjectileEntity redirectedProjectile = (DamagingProjectileEntity) redirected;
redirectedProjectile.accelerationX = (redirection.x / 4.0);
redirectedProjectile.accelerationY = (redirection.y / 4.0);
redirectedProjectile.accelerationZ = (redirection.z / 4.0);
}
}
use of net.minecraft.entity.projectile.WitherSkullEntity in project bewitchment by MoriyaShiine.
the class LilithEntity method tick.
@Override
public void tick() {
super.tick();
if (!world.isClient) {
bossBar.setPercent(getHealth() / getMaxHealth());
LivingEntity target = getTarget();
int timer = age + getId();
if (timer % 10 == 0) {
heal(1);
}
if (target != null) {
timeSinceLastAttack++;
if (timeSinceLastAttack >= 600) {
BWUtil.teleport(this, target.getX(), target.getY(), target.getZ(), true);
timeSinceLastAttack = 0;
}
lookAtEntity(target, 360, 360);
if (timer % 40 == 0) {
for (int i = -1; i <= 1; i++) {
WitherSkullEntity witherSkull = new WitherSkullEntity(world, this, target.getX() - getX() + (i * 2), target.getBodyY(0.5) - getBodyY(0.5), target.getZ() - getZ() + (i * 2));
witherSkull.updatePosition(witherSkull.getX(), getBodyY(0.5), witherSkull.getZ());
witherSkull.setOwner(this);
world.playSound(null, getBlockPos(), SoundEvents.ENTITY_WITHER_SHOOT, getSoundCategory(), getSoundVolume(), getSoundPitch());
world.spawnEntity(witherSkull);
}
swingHand(Hand.MAIN_HAND);
}
if (timer % 600 == 0) {
summonMinions(this);
}
} else {
if (getY() > -64) {
heal(8);
}
timeSinceLastAttack = 0;
}
}
}
use of net.minecraft.entity.projectile.WitherSkullEntity in project Neutrino by FrostWizard4.
the class WitherlingEntity method shootSkullAt.
private void shootSkullAt(int headIndex, double targetX, double targetY, double targetZ, boolean charged) {
if (!this.isSilent()) {
this.world.syncWorldEvent((PlayerEntity) null, WorldEvents.WITHER_SHOOTS, this.getBlockPos(), 0);
}
double d = this.getHeadX(headIndex);
double e = this.getHeadY(headIndex);
double f = this.getHeadZ(headIndex);
double g = targetX - d;
double h = targetY - e;
double i = targetZ - f;
WitherSkullEntity witherSkullEntity = new WitherSkullEntity(this.world, this, g, h, i);
witherSkullEntity.setOwner(this);
if (charged) {
witherSkullEntity.setCharged(true);
}
witherSkullEntity.setPos(d, e, f);
this.world.spawnEntity(witherSkullEntity);
}
Aggregations