Interface BallLogic
- 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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voiddoAfterEffect(PokeBall type, PokeBallEntity entity, PixelmonEntity pixelmon) default voiddoFailEffect(PokeBall type, PokeBallEntity entity, PixelmonEntity pixelmon) default doublegetCatchBonus(PokeBall type, PokeBallEntity entity, net.minecraft.world.entity.player.Player thrower, Pokemon pokemon, PokeBallMode mode) Get the ball bonus of this ball logic.default intmodifyCaptureRate(PokeBall type, PokeBallEntity entity, Pokemon pokemon, int catchRate)
-
Field Details
-
ULTRA_BEAST_RATE
static final double ULTRA_BEAST_RATE- See Also:
-
-
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- ThePokeBallbeing used.entity- ThePokeBallEntitybeing thrown, if one is present.thrower- The player throwing the ball.pokemon- ThePokemonbeing caught.mode- The mode this capture attempt is in.- Returns:
- The ball bonus of the Poké Ball given the provided parameters.
-
doAfterEffect
- Parameters:
type- ThePokeBallbeing used.entity- ThePokeBallEntitybeing thrown, if one is present.pixelmon- ThePixelmonEntitycaught.
-
modifyCaptureRate
default int modifyCaptureRate(PokeBall type, @Nullable PokeBallEntity entity, Pokemon pokemon, int catchRate) - Parameters:
type- ThePokeBallbeing used.entity- ThePokeBallEntitybeing thrown, if one is present.pokemon- ThePokemonbeing caught.catchRate- The base catch rate of thePokemonbeing caught.- Returns:
- The modified catch rate of the
Pokemonbeing caught.
-
doFailEffect
- Parameters:
type- ThePokeBallbeing used.entity- ThePokeBallEntitybeing thrown, if one is present.pixelmon- ThePixelmonEntitythat failed to be caught.
-