You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Mixin(LivingEntity.class)
abstract class LivingEntityMixin extends Entity {
LivingEntityMixin(final EntityType<?> type, final World world) {
super(type, world);
}
@Inject(method = "damage", at = @At("HEAD"))
private void modifyDamage(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
// ...
}
}
In the above code, I injected the beginning of the damage method, and I want to make it so that when a creature takes damage, it increases or decreases the amount of damage it takes based on certain conditions (which need to be determined using DamageSource). However, if I use @Inject, I cannot modify the parameters. If I use @ModifyVariable, I cannot get the other parameters.
The text was updated successfully, but these errors were encountered:
In the above code, I injected the beginning of the damage method, and I want to make it so that when a creature takes damage, it increases or decreases the amount of damage it takes based on certain conditions (which need to be determined using DamageSource). However, if I use @Inject, I cannot modify the parameters. If I use @ModifyVariable, I cannot get the other parameters.
The text was updated successfully, but these errors were encountered: