Improved blaze melee
This commit is contained in:
parent
b86e581fc5
commit
d7c7ffb038
|
|
@ -0,0 +1,25 @@
|
||||||
|
package xyz.nearmisses.patience.mc_rebalance.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.monster.Blaze;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
@Mixin(targets = "net.minecraft.world.entity.monster.Blaze$BlazeAttackGoal")
|
||||||
|
public class BlazeAIRework {
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
private int attackTime;
|
||||||
|
|
||||||
|
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/monster/Blaze;doHurtTarget(Lnet/minecraft/world/entity/Entity;)Z"))
|
||||||
|
public boolean meleeTick(Blaze instance, Entity entity) {
|
||||||
|
this.attackTime = 5; // 1/4 vanilla
|
||||||
|
boolean ret = entity.hurt( entity.damageSources().indirectMagic(instance, entity), (float) instance.getAttributeValue(Attributes.ATTACK_DAMAGE) ); // Do magic damage
|
||||||
|
entity.invulnerableTime = 0; // entity.hurt not affected by Logical IFrames
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package xyz.nearmisses.patience.mc_rebalance.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||||
|
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||||
|
import net.minecraft.world.entity.monster.Blaze;
|
||||||
|
import net.minecraft.world.entity.monster.Monster;
|
||||||
|
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(Blaze.class)
|
||||||
|
public class BlazeRework {
|
||||||
|
|
||||||
|
@Inject(method="createAttributes", at=@At("RETURN"), cancellable=true)
|
||||||
|
private static void createAttributes(CallbackInfoReturnable<AttributeSupplier.Builder> cir) {
|
||||||
|
cir.setReturnValue( Monster.createMonsterAttributes()
|
||||||
|
.add(Attributes.ATTACK_DAMAGE, 3.0) // Hits more often with lower-damage magic attacks
|
||||||
|
.add(Attributes.MOVEMENT_SPEED, 0.3F) // Moves faster BUT melee aggro range is unchanged so they still don't want to use it
|
||||||
|
.add(Attributes.FOLLOW_RANGE, 48.0) // Unchanged
|
||||||
|
.add(Attributes.ARMOR, 4.0) // More durable
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
"package": "xyz.nearmisses.patience.mc_rebalance.mixin",
|
"package": "xyz.nearmisses.patience.mc_rebalance.mixin",
|
||||||
"compatibilityLevel": "JAVA_21",
|
"compatibilityLevel": "JAVA_21",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
|
"BlazeAIRework",
|
||||||
|
"BlazeRework",
|
||||||
"ExperienceOrbRework",
|
"ExperienceOrbRework",
|
||||||
"WitherSkeletonRework"
|
"WitherSkeletonRework"
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue