Class BerryRecoilItem

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 BerryRecoilItem extends BerryItem
Damages a Pokémon who attacks the user if the attack is of a certain category.
  • Constructor Details

    • BerryRecoilItem

      public BerryRecoilItem(net.minecraft.world.item.Item.Properties properties, EnumHeldItems berryType, BerryType berry, AttackCategory attackCategory)
      Initializes a recoil Berry.
      Parameters:
      berryType - The type of held item.
      berry - The type of the berry (referenced off main berry enum)
      attackCategory - The index of the attack category that causes the Berry to trigger.
  • 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.