Effected is a library for minecraft fabric that makes adding effects for amror materials easy
just add
maven { url 'https://jitpack.io' }
to repositories
and
modImplementation 'com.github.z3roco01:effected:v1.0.1'
to dependencies
in build.gradle
to add an effect
import z3roco01.effected.ArmorEffect;
import z3roco01.effected.ArmorEffects;
ArmorEffect effect = new ArmorEffect(StatusEffects.SPEED, material -> material == ArmorMaterials.IRON, armors -> armors, "ironSpeed");
ArmorEffects.addEffect(effect);
The first argument in the ArmorEffect
constructor is the StatusEffect
that will be applied.
The second argument is a ArmorEffectMatch
in this case it's a lambda but it needs to return true if this ArmorMaterial
matches what it should.
The third argument is a ArmorEffectCalc
it can also be a lambda, it takes as an argument the number of armor pieces that match and returns the effect amplifier starting at 1 that sould be applied.
The forth argument is a id that should be unique for this effect.