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.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
doAfterEffect
(PokeBall type, PokeBallEntity entity, PixelmonEntity pixelmon) default void
doFailEffect
(PokeBall type, PokeBallEntity entity, PixelmonEntity pixelmon) default double
getCatchBonus
(PokeBall type, PokeBallEntity entity, net.minecraft.world.entity.player.Player thrower, Pokemon pokemon, PokeBallMode mode) Get the ball bonus of this ball logic.default int
modifyCaptureRate
(PokeBall type, PokeBallEntity entity, Pokemon pokemon, int catchRate)
-
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
- ThePokeBall
being used.entity
- ThePokeBallEntity
being thrown, if one is present.thrower
- The player throwing the ball.pokemon
- ThePokemon
being caught.mode
- The mode this capture attempt is in.- Returns:
- The ball bonus of the Poké Ball given the provided parameters.
-
doAfterEffect
- Parameters:
type
- ThePokeBall
being used.entity
- ThePokeBallEntity
being thrown, if one is present.pixelmon
- ThePixelmonEntity
caught.
-
modifyCaptureRate
default int modifyCaptureRate(PokeBall type, @Nullable PokeBallEntity entity, Pokemon pokemon, int catchRate) - Parameters:
type
- ThePokeBall
being used.entity
- ThePokeBallEntity
being thrown, if one is present.pokemon
- ThePokemon
being caught.catchRate
- The base catch rate of thePokemon
being caught.- Returns:
- The modified catch rate of the
Pokemon
being caught.
-
doFailEffect
- Parameters:
type
- ThePokeBall
being used.entity
- ThePokeBallEntity
being thrown, if one is present.pixelmon
- ThePixelmonEntity
that failed to be caught.
-