Class BerryStatusItem

All Implemented Interfaces:
ITranslatable, net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.ItemLike, net.minecraftforge.common.extensions.IForgeItem, net.minecraftforge.common.IPlantable

public class BerryStatusItem extends BerryItem
A Berry that heals a certain status on a Pokémon.
  • Constructor Details

    • BerryStatusItem

      public BerryStatusItem(net.minecraft.world.item.Item.Properties properties, BerryType berry, StatusType... statusHealed)
      Initializes a Berry.
      Parameters:
      berry - The type of the Berry (referenced off main Berry enum).
      statusHealed - The statuses healed by the Berry.
  • Method Details

    • interact

      public boolean interact(PixelmonEntity pokemon, net.minecraft.world.item.ItemStack itemstack, net.minecraft.world.entity.player.Player player)
      Description copied from class: HeldItem
      Overrides the standard held item interaction (equipping the held item) if needed.
      Overrides:
      interact in class HeldItem
      Parameters:
      pokemon - The Pokémon being given the item.
      itemstack - The itemstack used to interact.
      player - The player using the item.
      Returns:
      Whether the item was used.
    • 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.
    • applyRepeatedEffect

      public void applyRepeatedEffect(PixelmonWrapper pw)
      Description copied from class: HeldItem
      Triggers at the end of every turn.
      Overrides:
      applyRepeatedEffect in class HeldItem
      Parameters:
      pw - The holder.
    • eatBerry

      public void eatBerry(PixelmonWrapper pokemon)
      Description copied from class: HeldItem
      Called within Berry classes after determining whether or not the Berry will be eaten. Also called directly by certain moves (e.g., Bug Bite, Pluck).
      Overrides:
      eatBerry in class HeldItem
      Parameters:
      pokemon - The Pokémon consuming the Berry.
    • 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 corresponding statuses as defined by the Berry.
      Parameters:
      pokemon - The Pokémon being healed.
      Returns:
      Whether any status was healed.
    • canHealStatus

      public boolean canHealStatus(StatusType status)
      Checks if the Berry can heal a certain status.
      Parameters:
      status - The status to check for.
      Returns:
      Whether the can heal the specified status.