Class BerryRestoreHPItem

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 BerryRestoreHPItem extends BerryItem
Berries that restore the holder's hp.
  • Field Details

    • confusedStat

      public final BattleStatsType confusedStat
      The stat that will caused the Pokémon to be confused if its Nature lowers the stat.
  • Constructor Details

    • BerryRestoreHPItem

      public BerryRestoreHPItem(net.minecraft.world.item.Item.Properties properties, BerryType berry, BattleStatsType confusedStat)
      Initializes the Berry.
      Parameters:
      berry - The type of the Berry (referenced off main Berry enum).
      confusedStat - The stat that will caused the Pokémon to be confused if its Nature lowers the stat.
  • 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.
    • tookDamage

      public void tookDamage(PixelmonWrapper attacker, PixelmonWrapper pokemon, float damage, DamageTypeEnum damageType)
      Description copied from class: HeldItem
      Triggers when the holder takes damage.
      Overrides:
      tookDamage in class HeldItem
      Parameters:
      attacker - The source of the damage.
      pokemon - The target of the damage.
      damage - The damage dealt.
      damageType - The type of damage that was dealt.
    • 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.
    • 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.
    • healPokemon

      public boolean healPokemon(PixelmonWrapper pokemon)
      Heals the Pokémon by the Berry's amount. If the Berry and the Pokémon's Nature clash, the Pokémon gets confused.
      Parameters:
      pokemon - The Pokémon being healed.
      Returns:
      Whether the Pokémon was healed.
    • getHealAmount

      public IHealHP getHealAmount()
      Gets the calculation for the Berry's healing amount.
      Returns:
      The calculation for the Berry's healing amount.
    • getThreshold

      public int getThreshold(PixelmonWrapper user)