Class MentalHerbItem

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

public class MentalHerbItem extends HeldItem
Heals certain statuses that deal with the Pokémon's mental state.
  • Constructor Details

    • MentalHerbItem

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

    • onStatusAdded

      public void onStatusAdded(PixelmonWrapper user, PixelmonWrapper opponent, StatusBase status)
      Description copied from class: HeldItem
      Triggers when the holder is statused.
      Overrides:
      onStatusAdded in class HeldItem
      Parameters:
      user - The statused Pokémon.
      opponent - The Pokémon that caused the status.
      status - The new status.
    • applySwitchInEffect

      public void applySwitchInEffect(PixelmonWrapper newPokemon)
      Description copied from class: HeldItem
      Triggers when the holder switches in and when a Pokémon receives a held item in battle.
      Overrides:
      applySwitchInEffect in class HeldItem
      Parameters:
      newPokemon - The Pokémon switching in.
    • useFromBag

      public boolean useFromBag(PixelmonWrapper userWrapper, PixelmonWrapper targetWrapper, net.minecraft.world.item.ItemStack stack)
      Description copied from class: PixelmonItem
      Uses the item in battle.
      Overrides:
      useFromBag in class PixelmonItem
      Parameters:
      userWrapper - The Pokémon whose turn is being spent using the item.
      targetWrapper - The Pokémon the item is being used on.
      stack - The item stack used.
      Returns:
      Whether to remove an instance of the item from the player's inventory.
    • healStatus

      public boolean healStatus(PixelmonWrapper pokemon)
      Heals the statuses on the Pokémon that the Mental Herb heals.
      Parameters:
      pokemon - The Pokémon being healed.
      Returns:
      Whether any statuses were healed.