Class EjectButtonItem

java.lang.Object
net.minecraft.world.item.Item
com.pixelmonmod.pixelmon.items.PixelmonItem
com.pixelmonmod.pixelmon.items.HeldItem
com.pixelmonmod.pixelmon.items.heldItems.EjectButtonItem
All Implemented Interfaces:
ITranslatable, net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.ItemLike, net.neoforged.neoforge.common.extensions.IItemExtension

public class EjectButtonItem extends HeldItem
Switches out the holder when attacked.
  • Constructor Details

    • EjectButtonItem

      public EjectButtonItem()
      Initializes the held item.
  • Method Details

    • postProcessDamagingAttackTarget

      public void postProcessDamagingAttackTarget(PixelmonWrapper attacker, PixelmonWrapper target, Attack attack, float damage, DamageTypeEnum damageType)
      Description copied from class: HeldItem
      Triggers after the holder is hit by a damaging attack.
      Overrides:
      postProcessDamagingAttackTarget in class HeldItem
      Parameters:
      attacker - The attack's user.
      target - The attack's target.
      attack - The attack.
      damage - The damage dealt.
      damageType - The type of damage dealt.
    • applyEffectAfterAllMoveEffects

      public void applyEffectAfterAllMoveEffects(PixelmonWrapper attacker, PixelmonWrapper target)
      Description copied from class: HeldItem
      Triggers after all the targets of an attack have defended.
      Overrides:
      applyEffectAfterAllMoveEffects in class HeldItem
      Parameters:
      attacker - The move's user.
      target - The Pokémon defending from the attacker.
    • checkIfCanSwitchAndThenSwitch

      public void checkIfCanSwitchAndThenSwitch(PixelmonWrapper itemHolder)