Package com.binaris.wizardry.core
Class QuickArtifactEffect
java.lang.Object
com.binaris.wizardry.core.QuickArtifactEffect
- All Implemented Interfaces:
IArtifactEffect
Utility class used for quickly add artifacts effect to items without having to create a whole new effect class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IArtifactEffectchangeDamageIfSource(@Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> damageType, float value, SpellModifiers.Operation operation) Used for artifacts that changes the incoming damage if the damage type matches the specified onestatic IArtifactEffectchangeModifiers(String modifierKey, float value, SpellModifiers.Operation operation) Used for artifacts that always modifySpellModifierswhen cast.static IArtifactEffectchangeModifiersByBiomeElement(Element element, Predicate<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> predicate, String modifierKey, float value, SpellModifiers.Operation operation) Based on the cast spell element and if the biome matches the predicate, it will change theSpellModifiersstatic IArtifactEffectchangeModifiersIfCasting(Supplier<Spell> spell, String modifierKey, float value, SpellModifiers.Operation operation) Used for artifacts that changesSpellModifierswhen the player cast a specific spell.static IArtifactEffectchangeModifiersIfCastingType(SpellType type, String modifierKey, float value, SpellModifiers.Operation operation) Used for artifacts that changesSpellModifierswhen te player cast a spell of the selected spell-typestatic IArtifactEffectmeleeRing(Element element, @Nullable net.minecraft.world.effect.MobEffect effect, int level, int ticks) Used for artifacts that checks if the player attacks a living entity with a wand of the selected element, in the case that's true it will give the affected entity a selected mob effect.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.binaris.wizardry.core.IArtifactEffect
onHurtEntity, onKillEntity, onPlayerHurt, onSpellPostCast, onSpellPreCast, onTick
-
Constructor Details
-
QuickArtifactEffect
public QuickArtifactEffect()
-
-
Method Details
-
changeModifiers
public static IArtifactEffect changeModifiers(String modifierKey, float value, SpellModifiers.Operation operation) Used for artifacts that always modifySpellModifierswhen cast. Loaded in the pre-cast event.- Parameters:
modifierKey- The key of the modifier to modify.value- The value to add or multiply to the modifier.operation- The operation to apply to the modifier.- Returns:
- An instance of
IArtifactEffect(used to be registered with theArtifactItem
-
changeModifiersIfCasting
public static IArtifactEffect changeModifiersIfCasting(Supplier<Spell> spell, String modifierKey, float value, SpellModifiers.Operation operation) Used for artifacts that changesSpellModifierswhen the player cast a specific spell.- Parameters:
spell- The spell to check.modifierKey- The key of the modifier to modify.value- The value to add or multiply to the modifier.operation- The operation to apply to the modifier.- Returns:
- An instance of
IArtifactEffect(used to be registered with theArtifactItem
-
changeModifiersIfCastingType
public static IArtifactEffect changeModifiersIfCastingType(SpellType type, String modifierKey, float value, SpellModifiers.Operation operation) Used for artifacts that changesSpellModifierswhen te player cast a spell of the selected spell-type- Parameters:
type- The spell-type to check.modifierKey- The key of the modifier to modify.value- The value to add or multiply to the modifier.operation- The operation to apply to the modifier.- Returns:
- An instance of
IArtifactEffect(used to be registered with theArtifactItem
-
meleeRing
public static IArtifactEffect meleeRing(Element element, @Nullable @Nullable net.minecraft.world.effect.MobEffect effect, int level, int ticks) Used for artifacts that checks if the player attacks a living entity with a wand of the selected element, in the case that's true it will give the affected entity a selected mob effect.- Parameters:
element- The element of the wand to check.effect- The mob effect to give to the affected entity. If null, the entity will be set on fire.level- The level of the mob effect.ticks- The duration of the mob effect.- Returns:
- An instance of
IArtifactEffect(used to be registered with theArtifactItem
-
changeModifiersByBiomeElement
public static IArtifactEffect changeModifiersByBiomeElement(Element element, Predicate<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> predicate, String modifierKey, float value, SpellModifiers.Operation operation) Based on the cast spell element and if the biome matches the predicate, it will change theSpellModifiers- Parameters:
element- The element of the wand to checkpredicate- The predicate to check the biomemodifierKey- The key of the modifier to modifyvalue- The value to add or multiply to the modifieroperation- The operation to apply to the modifier- Returns:
- An instance of
IArtifactEffect(used to be registered with theArtifactItem
-
changeDamageIfSource
public static IArtifactEffect changeDamageIfSource(@Nullable @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> damageType, float value, SpellModifiers.Operation operation) Used for artifacts that changes the incoming damage if the damage type matches the specified one- Parameters:
damageType- The damage type to checkvalue- The value to add or multiply to the modifieroperation- The operation to apply to the modifier- Returns:
- An instance of
IArtifactEffect(used to be registered with theArtifactItem
-