Tweak melee fighters
Zombies sprint within 8 blocks Piglins deal reduced damage (still higher than vanilla due to axe changes)
This commit is contained in:
parent
483569ce0a
commit
66638532f3
|
|
@ -0,0 +1,23 @@
|
||||||
|
package xyz.nearmisses.patience.mc_rebalance.mixin.mob;
|
||||||
|
|
||||||
|
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.piglin.PiglinBrute;
|
||||||
|
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.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(PiglinBrute.class)
|
||||||
|
public class PiglinBruteTweak {
|
||||||
|
@Inject(method="createAttributes", at=@At("RETURN"), cancellable=true)
|
||||||
|
private static void createAttributes(CallbackInfoReturnable<AttributeSupplier.Builder> cir) {
|
||||||
|
cir.setReturnValue(Monster.createMonsterAttributes()
|
||||||
|
.add(Attributes.MAX_HEALTH, 50.0F)
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.35F)
|
||||||
|
.add(Attributes.ATTACK_DAMAGE, 3.0F) // Default 7, cumulative with axe change = 12
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package xyz.nearmisses.patience.mc_rebalance.mixin.mob;
|
||||||
|
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.monster.Monster;
|
||||||
|
import net.minecraft.world.entity.monster.Zombie;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Mixin(Zombie.class)
|
||||||
|
public class ZombieRework extends Monster{
|
||||||
|
|
||||||
|
protected ZombieRework(EntityType<? extends Monster> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method="tick", at=@At("TAIL"))
|
||||||
|
private void sprintNearToTarget(CallbackInfo ci){
|
||||||
|
if(this.getTarget()!=null && this.getTarget().position().distanceTo(this.position())<8){
|
||||||
|
this.setSprinting(true);
|
||||||
|
}
|
||||||
|
if(this.isSprinting() && this.getTarget()==null) {
|
||||||
|
this.setSprinting(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,8 +14,10 @@
|
||||||
"mob.EnderDragonHitRateCap",
|
"mob.EnderDragonHitRateCap",
|
||||||
"mob.HappyGhastTweak",
|
"mob.HappyGhastTweak",
|
||||||
"mob.MagmaCubeTweak",
|
"mob.MagmaCubeTweak",
|
||||||
|
"mob.PiglinBruteTweak",
|
||||||
"mob.WardenRework",
|
"mob.WardenRework",
|
||||||
"mob.WitherSkeletonRework"
|
"mob.WitherSkeletonRework",
|
||||||
|
"mob.ZombieRework"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue