Class QuickArtifactEffect

java.lang.Object
com.binaris.wizardry.core.QuickArtifactEffect
All Implemented Interfaces:
IArtifactEffect

public class QuickArtifactEffect extends Object implements IArtifactEffect
Utility class used for quickly add artifacts effect to items without having to create a whole new effect class.
See Also:
  • Constructor Details

    • QuickArtifactEffect

      public QuickArtifactEffect()
  • Method Details

    • changeModifiers

      public static IArtifactEffect changeModifiers(String modifierKey, float value, SpellModifiers.Operation operation)
      Used for artifacts that always modify SpellModifiers when 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 the ArtifactItem
    • changeModifiersIfCasting

      public static IArtifactEffect changeModifiersIfCasting(Supplier<Spell> spell, String modifierKey, float value, SpellModifiers.Operation operation)
      Used for artifacts that changes SpellModifiers when 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 the ArtifactItem
    • changeModifiersIfCastingType

      public static IArtifactEffect changeModifiersIfCastingType(SpellType type, String modifierKey, float value, SpellModifiers.Operation operation)
      Used for artifacts that changes SpellModifiers when 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 the ArtifactItem
    • 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 the ArtifactItem
    • 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 the SpellModifiers
      Parameters:
      element - The element of the wand to check
      predicate - The predicate to check the biome
      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 the ArtifactItem
    • 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 check
      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 the ArtifactItem