Class BerryJuiceItem

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

public class BerryJuiceItem extends HeldItem
Heals the holder by 20 hp when hp drops below 50%.
  • Constructor Details

    • BerryJuiceItem

      public BerryJuiceItem(net.minecraft.world.item.Item.Properties properties)
  • 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.
    • 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.
    • 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.