Attack damage builds from 0 instead of 0.2

This commit is contained in:
patience 2026-03-28 01:35:43 +00:00
parent f72fe4b778
commit 4efacd691c
No known key found for this signature in database

View file

@ -10,9 +10,7 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
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.Inject;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@ -45,4 +43,14 @@ public abstract class PlayerTweaks extends LivingEntity {
// Lose no XP for levelling up
@ModifyVariable(method = "onEnchantmentPerformed", at = @At("HEAD"), ordinal = 0, argsOnly = true)
private int onEnchantmentPerformed(int i){return 0;}
// Start attack damage buildup from 0.0 instead of 0.2
@ModifyConstant(method="attack", constant=@Constant(floatValue = 0.2F))
private float attackBuildupLow(float constant){
return 0.0F;
}
@ModifyConstant(method="attack", constant=@Constant(floatValue = 0.8F))
private float attackBuildupHigh(float constant){
return 1.0F;
}
}