Skip to content

Commit

Permalink
Fix some problem of Disturbed Hollow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glyceryl6 committed Dec 1, 2023
1 parent 9e842b3 commit 8bcf7d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected void registerGoals() {
public static AttributeSupplier.Builder createAttributes() {
AttributeSupplier.Builder builder = Monster.createMonsterAttributes();
builder.add(Attributes.MAX_HEALTH, 20.0F);
builder.add(Attributes.MOVEMENT_SPEED, 0.3F);
builder.add(Attributes.MOVEMENT_SPEED, 0.2F);
builder.add(Attributes.ATTACK_DAMAGE, 3.0F);
builder.add(Attributes.FOLLOW_RANGE, 35.0D);
builder.add(Attributes.ARMOR, 2.0F);
Expand Down Expand Up @@ -129,6 +129,7 @@ public void tick() {
Level level = this.disturbedHollow.level();
++this.chargeTime;
if (this.chargeTime == 20) {
this.disturbedHollow.setDeltaMovement(Vec3.ZERO);
Vec3 vec3 = this.disturbedHollow.getViewVector(1.0F);
double d2 = target.getX() - (this.disturbedHollow.getX() + vec3.x * 4.0D);
double d3 = target.getY(0.5D) - (0.5D + this.disturbedHollow.getY(0.5D));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.monster.Monster;
import net.minecraft.world.entity.projectile.AbstractHurtingProjectile;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.EntityHitResult;
Expand Down Expand Up @@ -48,7 +49,7 @@ public void tick() {
protected void onHitEntity(EntityHitResult result) {
if (!this.level().isClientSide) {
Entity entity = result.getEntity();
if (entity != this.getOwner()) {
if (this.getOwner() instanceof Monster monster && entity == monster.getTarget()) {
entity.hurt(this.damageSources().magic(), 2.0F);
}
}
Expand Down

0 comments on commit 8bcf7d0

Please sign in to comment.