Interface IArtifactEffect

All Known Implementing Classes:
AmuletPotentialEffect, ArcaneDefenseAmuletEffect, ArcaneFrostRingEffect, AutoShieldAmuletEffect, BanishingAmuletEffect, BattlemageRingEffect, ChannelingAmuletEffect, CombustionRingEffect, CondensingRingEffect, ConjurerRingEffect, ExtractionRingEffect, FeedingCharmEffect, FireCloakingAmuletEffect, FrostWardingAmuletEffect, FullMoonRingEffect, HungerCastingCharmEffect, LeechingRingEffect, LichAmuletEffect, LightningMeleeEffect, PaladinRingEffect, PoisonRingEffect, QuickArtifactEffect, RecoveryAmuletEffect, RingStormEffect, ShatteringRingEffect, SoulBindingRingEffect, TransienceAmuletEffect

public interface IArtifactEffect
Interface representing the effects of artifacts in the mod. This provides methods that can be overridden to define custom behavior for artifacts based on events. These methods are loaded by the ArtifactItem class to register the effects inside the event bus.

You have all the freedom to add a custom implementation of this interface for your own artifacts, but if you do so, you must ensure to load the events yourself.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    onHurtEntity(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.LivingEntity damagedEntity, net.minecraft.world.damagesource.DamageSource source, com.google.common.util.concurrent.AtomicDouble amount, AtomicBoolean canceled, net.minecraft.world.item.ItemStack artifact)
    Called when the player is responsible for hurting an entity (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
    default void
    onKillEntity(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.LivingEntity deadEntity, net.minecraft.world.damagesource.DamageSource source, net.minecraft.world.item.ItemStack artifact)
    Called when the player is responsible for killing an entity (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
    default void
    onPlayerHurt(net.minecraft.world.entity.player.Player player, net.minecraft.world.damagesource.DamageSource source, com.google.common.util.concurrent.AtomicDouble amount, AtomicBoolean canceled, net.minecraft.world.item.ItemStack artifact)
    Called when the player is hurt (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect
    default void
    onSpellPostCast(SpellCastEvent.Post event, net.minecraft.world.item.ItemStack artifact)
    Called after a spell is cast (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
    default void
    onSpellPreCast(SpellCastEvent.Pre event, net.minecraft.world.item.ItemStack artifact)
    Called before a spell is cast (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
    default void
    onTick(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack artifact)
    Called when the player is responsible for killing an entity (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
  • Method Details

    • onTick

      default void onTick(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack artifact)
      Called when the player is responsible for killing an entity (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
      Parameters:
      player - The player wearing the artifact
      level - The level the player is in
      artifact - The artifact stack
    • onKillEntity

      default void onKillEntity(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.LivingEntity deadEntity, net.minecraft.world.damagesource.DamageSource source, net.minecraft.world.item.ItemStack artifact)
      Called when the player is responsible for killing an entity (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
      Parameters:
      player - The player wearing the artifact
      deadEntity - The entity that was killed
      source - The damage source
      artifact - The artifact stack
    • onHurtEntity

      default void onHurtEntity(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.LivingEntity damagedEntity, net.minecraft.world.damagesource.DamageSource source, com.google.common.util.concurrent.AtomicDouble amount, AtomicBoolean canceled, net.minecraft.world.item.ItemStack artifact)
      Called when the player is responsible for hurting an entity (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
      Parameters:
      player - The player wearing the artifact
      damagedEntity - The entity that was hurt
      source - The damage source
      amount - The amount of damage (mutable)
      canceled - Whether the damage event has been canceled
      artifact - The artifact stack
    • onPlayerHurt

      default void onPlayerHurt(net.minecraft.world.entity.player.Player player, net.minecraft.world.damagesource.DamageSource source, com.google.common.util.concurrent.AtomicDouble amount, AtomicBoolean canceled, net.minecraft.world.item.ItemStack artifact)
      Called when the player is hurt (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect
      Parameters:
      player - The player wearing the artifact
      source - The damage source
      amount - The amount of damage (mutable)
      canceled - Whether the damage event has been canceled
      artifact - The artifact stack
    • onSpellPreCast

      default void onSpellPreCast(SpellCastEvent.Pre event, net.minecraft.world.item.ItemStack artifact)
      Called before a spell is cast (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
      Parameters:
      event - The spell cast event
      artifact - The artifact stack
    • onSpellPostCast

      default void onSpellPostCast(SpellCastEvent.Post event, net.minecraft.world.item.ItemStack artifact)
      Called after a spell is cast (if player carries the artifact in their hotbar or accessories) to apply the artifact's effect.
      Parameters:
      event - The spell cast event
      artifact - The artifact stack