All Known Implementing Classes:
BeastBall, ChristmasBallLogic, DiveBall, DreamBall, DuskBall, FastBall, FriendBall, HealBall, HeavyBall, HisuiBall, LevelBall, LoveBall, LureBall, LuxuryBall, MoonBall, NestBall, NetBall, QuickBall, RepeatBall, SafariBall, SportBall, TimerBall

public interface BallLogic
Interface representing the logic used by a PokeBall for capture purposes. The methods here are generally called by CaptureMethod in order to facilitate the capture calculation. You can determine if the capture attempt is in a battle by checking the PokeBallMode, or checking if a PixelmonWrapper is present in the Pokemon parameter. Instances of this are not registered - PokeBall creates new instances of this class from a provided classpath.
  • Field Details

  • Method Details

    • getCatchBonus

      default double getCatchBonus(PokeBall type, @Nullable PokeBallEntity entity, net.minecraft.world.entity.player.Player thrower, Pokemon pokemon, PokeBallMode mode)
      Get the ball bonus of this ball logic. This may be different depending on whether the capture attempt is in a battle or not.
      Parameters:
      type - The PokeBall being used.
      entity - The PokeBallEntity being thrown, if one is present.
      thrower - The player throwing the ball.
      pokemon - The Pokemon being caught.
      mode - The mode this capture attempt is in.
      Returns:
      The ball bonus of the Poké Ball given the provided parameters.
    • doAfterEffect

      default void doAfterEffect(PokeBall type, @Nullable PokeBallEntity entity, PixelmonEntity pixelmon)
      Action to be performed after a Pokemon is successfully caught in a PokeBall with this logic.
      Parameters:
      type - The PokeBall being used.
      entity - The PokeBallEntity being thrown, if one is present.
      pixelmon - The PixelmonEntity caught.
    • modifyCaptureRate

      default int modifyCaptureRate(PokeBall type, @Nullable PokeBallEntity entity, Pokemon pokemon, int catchRate)
      Get the modified catch rate of the Pokemon being caught in a PokeBall with this logic.
      Parameters:
      type - The PokeBall being used.
      entity - The PokeBallEntity being thrown, if one is present.
      pokemon - The Pokemon being caught.
      catchRate - The base catch rate of the Pokemon being caught.
      Returns:
      The modified catch rate of the Pokemon being caught.
    • doFailEffect

      default void doFailEffect(PokeBall type, @Nullable PokeBallEntity entity, PixelmonEntity pixelmon)
      Action to be performed after a Pokemon is unsuccessfully caught in a PokeBall with this logic.
      Parameters:
      type - The PokeBall being used.
      entity - The PokeBallEntity being thrown, if one is present.
      pixelmon - The PixelmonEntity that failed to be caught.