Zombies are faster and aggro for slightly less distance
This commit is contained in:
parent
3108334b23
commit
96eb25aa78
|
|
@ -1,6 +1,8 @@
|
|||
package xyz.nearmisses.patience.mc_rebalance.mixin.mob;
|
||||
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.monster.Monster;
|
||||
import net.minecraft.world.entity.monster.Zombie;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
|
@ -8,6 +10,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(Zombie.class)
|
||||
public class ZombieRework extends Monster{
|
||||
|
|
@ -16,13 +19,27 @@ public class ZombieRework extends Monster{
|
|||
super(entityType, level);
|
||||
}
|
||||
|
||||
@Inject(method="createAttributes", at=@At("RETURN"), cancellable=true)
|
||||
private static void createAttributes(CallbackInfoReturnable<AttributeSupplier.Builder> cir) {
|
||||
cir.setReturnValue(Monster.createMonsterAttributes()
|
||||
.add(Attributes.FOLLOW_RANGE, 30.0F) // -5 from vanilla
|
||||
.add(Attributes.MOVEMENT_SPEED, 0.35F) // +.12 from vanilla
|
||||
.add(Attributes.ATTACK_DAMAGE, 3.0F)
|
||||
.add(Attributes.ARMOR, 2.0F)
|
||||
.add(Attributes.SPAWN_REINFORCEMENTS_CHANCE)
|
||||
);
|
||||
}
|
||||
|
||||
@Inject(method="tick", at=@At("TAIL"))
|
||||
private void sprintNearToTarget(CallbackInfo ci){
|
||||
if(this.getTarget()!=null && this.getTarget().position().distanceTo(this.position())<8){
|
||||
if(this.getTarget()!=null && this.getTarget().position().distanceTo(this.position())<12){
|
||||
this.setSprinting(true);
|
||||
}
|
||||
if(this.isSprinting() && this.getTarget()==null) {
|
||||
this.setSprinting(false);
|
||||
if(this.isSprinting()) {
|
||||
if(this.canSpawnSprintParticle()){spawnSprintParticle();}
|
||||
if(this.getTarget()==null) {
|
||||
this.setSprinting(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue