Class PixelmonWrapper
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.PixelmonWrapper
Wrapper for a Pokémon in battle.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Element
A temporary type added to the Pokémon.int
The number of times the Pokémon has successfully used AllySwitch in a row.int
The amount of times the Pokémon has taken an instance of damage over the entire battle.boolean
Whether to animate hp changes client-side.The Pokémon's current attack.boolean
Whether the last attack this pokemon performed succeeded.int
The Pokémon's position in battle.The battle controller for the battle the Pokémon is in.protected int
boolean
Whether the Pokémon can attack in the turn.boolean
Whether the Pokémon is a Burmy that should change form after the battle.The attack that a choice item has restricted the holder to.boolean
Whether the Pokémon's choice item was just swapped with another.int
The amount of damage the Pokémon has taken in the turn.int
boolean
Whether the Pokémon has eaten a Berry during the battle.boolean
Whether the Pokémon is currently eating a Berry to cure status.boolean
Whether this Eject Pack can activate from a stat being lowered.The Pokémon wrapped by this wrapper.int
The number of times the Pokémon has attempted to escape in the battle.The query used to Mega Evolve the Pokémon.boolean
Whether the Pokémon mega evolved/dynamaxed during this turn.boolean
Whether the Pokémon fainted due to end of turn effects.boolean
Whether the Pokémon is currently eating a Berry regardless of benefitsboolean
Whether the Pokémon has awarded experience upon fainting.boolean
Whether the Pokémon has already been in this battle.boolean
The original type of the Pokémon.boolean
Whether the user is in the middle of a multi-hit move.boolean
Whether the user is on the first hit of Parental Bond.boolean
Whether the user is using a reflected move.boolean
Whether the user is waiting to activate an effect.int
Whether the Pokémon is Dynamaxed (1)/Gigantamaxed (2).boolean
Whether the Pokémon is Mega Evolved.boolean
Whether the Pokémon is switching in the turn.boolean
Whether the Pokémon is performing a called move.The Pokémon's previous attack.The damage category of the last direct damage that was dealt the Pokémon was attacked in the current turn.int
The amount of direct damage that was dealt the last time the Pokémon was attacked in the current turn.int
The last position of the Pokémon in the battle.int
The amount of HP this pokemon had before recieving damage.The Pokémon's previous attack that the AI simulated.The Pokémon's previous temp attack that the AI simulated.The Pokémon's previous temp attack.int
int
The current boost from a Metronome held item.The Pokémon that this Pokémon will switch into.boolean
Whether the Pokémon is switching out because of the effects of a move.boolean
Whether the Pokémon is fighting on the field of battle instead of in the party.protected BattleParticipant
The participant who owns this Pokémon.The Pokemon object underlying this wrapper.float
The Pokémon's priority in the turn.int
The number of times the Pokémon has successfully used Protect (or similar moves) in a row.The attack the Pokémon selected for the turn.int
Barriers for Raid Pokémon.boolean
The Pokémon's type.boolean
Whether the Pokémon switched in during the previous turn.boolean
Whether the Pokémon switched in during the current turn.int
The index of the current target of an attack when iterating through targets.The targets of the Pokémon's attack.The temporary Ability of the Pokémon if it is changed.protected PokemonLevel
The Pokémon's type.The moves used by the Pokémon since it last entered battle.boolean
Whether or not the Pokémon is using a Z-Move.boolean
boolean
Whether the Pokémon is currently waiting for other combatants to make a move in battle.boolean
Whether the Pokémon will evolve during the turn.boolean
Whether the Pokémon will try to flee in the turn.net.minecraft.world.item.ItemStack
The item that is being used on the Pokémon.int
An additional argument for the item used on the Pokémon.The UUID of the Pokémon. -
Constructor Summary
ConstructorDescriptionPixelmonWrapper
(Pokemon pokemon) PixelmonWrapper
(BattleParticipant participant, Pokemon pokemon) Constructs the wrapper.PixelmonWrapper
(BattleParticipant participant, PixelmonEntity entity) Constructs the wrapper.PixelmonWrapper
(BattleParticipant participant, PixelmonEntity pixelmon, BattleController bc) Constructs up the wrapper.Makes a deep copy of the PixelmonWrapper objectPixelmonWrapper
(PixelmonEntity entity) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Updates experience-gaining Pokémon to and from the Pokémon.void
Adds a global statuses and allows items to catch when one is added.boolean
addStatus
(StatusBase e, PixelmonWrapper opponent) Adds a status to the Pokémon.boolean
addStatus
(StatusBase e, PixelmonWrapper opponent, net.minecraft.network.chat.MutableComponent message) Adds a status to the Pokémon.boolean
addTeamStatus
(StatusBase status, PixelmonWrapper cause) Adds a team status to all Pokémon on this Pokémon's side of the field.boolean
Sets the tertiary added type.void
void
afterSwitch
(PixelmonWrapper oldPokemon) Handles effects that occur just after switching out.boolean
Checks if the Pokémon's attack can be redirectedboolean
Checks if the Pokémon's attack makes contactvoid
beforeSwitch
(PixelmonWrapper switchingIn) Handles effects that occur just before switching out.boolean
boolean
Checks if the Pokémon can Dynamax.static boolean
canDynamax
(Stats form, HeldItem item) Checks if a Pokémon can Dynamax.boolean
boolean
Checks if the Pokémon can Gigantamax.static boolean
canGigantamax
(boolean gigantamaxFactor, Species species, Stats form) Checks if a Pokémon can Gigantamax.boolean
Checks if the Pokémon can Mega Evolve with its held item.static boolean
canMegaEvolve
(HeldItem heldItem, Species species, String form) Checks if a Pokémon can Mega Evolve with a held item.static boolean
canMegaEvolve
(net.minecraft.world.item.ItemStack heldItem, Species pokemon, String form) Checks if a Pokémon can Mega Evolve with a held item.boolean
cannotHaveStatus
(StatusBase t, PixelmonWrapper opponent) Checks whether the Pokémon can receive the status.boolean
cannotHaveStatus
(StatusBase t, PixelmonWrapper opponent, boolean ignorePrimaryOverlap) Checks whether the Pokémon can receive the status.boolean
Checks if the Pokémon can Ultra Burst with its held item.static boolean
canUltraBurst
(Species species, HeldItem heldItem, Stats form) Checks if a Pokémon can Ultra Burst (Necrozma only) with a held item.static boolean
canUseZMove
(net.minecraft.world.item.ItemStack heldItem) void
Chooses a move to use depending on the AI.void
chooseMove
(MoveChoice moveChoice) Prepares a move based on a move choice.void
Removes all statuses from the Pokémon.void
Resets variables that keep track of aspects within turns.void
Consumes the Pokémon's held item.copy()
int
countStatuses
(StatusType... statuses) Counts the number of statuses from a list that the Pokémon has.float
doBattleDamage
(PixelmonWrapper source, float damage, DamageTypeEnum damageType) Damages the Pokémon in battle.boolean
Checks if the Pokémon can gain experience and pokemonLevel up.doSwitch()
Handles switching.boolean
dynamax
(boolean revert, float healthPercentage) void
Causes the Pokémon to regain a lost held item after the battle ends.void
endTurn()
boolean
protected PixelmonWrapper
findPixelmon
(UUID uuid) void
Force a Pokémon targeting the current Pokémon with Pursuit to attack.void
forceRandomSwitch
(UUID switchPokemon) Randomly switches the Pokémon out for another.Gets the Pokémon's Ability.Returns the tertiary added type.Gets Pokémon that this Pokémon has faced during battle.Gets the Pokémon's actual Nature.Fetches the pokémon's base types, ignoring added and suppressed types.Gets the Pokémon's active Ability in battle.getBattleAbility
(boolean canIgnore) Gets the Pokémon's Ability in battle.getBattleAbility
(boolean canIgnore, PixelmonWrapper moveUser) Gets the Pokémon's Ability in battle.getBattleAbility
(boolean canIgnore, PixelmonWrapper moveUser, boolean ignoreShield) Gets the Pokémon's Ability in battle.getBattleAbility
(PixelmonWrapper moveUser) Gets the Pokémon's Ability in battle.Gets the battle AI of the Pokémon's participant.Gets the Pokémon's stats and stat modifiers.int
Returns the Pokémon's most recent consumed held item.int
Returns the index of the Pokémon in its participant's controlled Pokémon array.int
double
getEffectiveTypes
(PixelmonWrapper user, PixelmonWrapper target) Modifies the Pokémon's type to calculate type effectiveness if there are statuses that do so.Gets the entry hazards on the Pokémon's side of the field.int
getExp()
Gets the Pokémon's experience.getForm()
Gets the form index of the Pokémon.int
Gets the object that tracks friendship.Gets the Pokémon's gender.float
getHealPercent
(float amount) Returns the percentage of health that the Pokémon will recover from an amount.int
int
getHealth
(boolean ignoreDynamax) Returns the current hp of the Pokémon.int
Returns the difference between the Pokémon's maximum and current health.float
Returns the Pokémon's current health percentage.float
getHealthPercent
(float amount) Returns the Pokémon's health percentage compared to a certain amount.Gets the type of the item the Pokémon is holding.Gets the original type of the Pokémon if it is changed.Gets the Pokémon stored inside this wrapper.int
int
getMaxHealth
(boolean ignoreDynamax) Returns the maximum hp of the Pokémon.Returns the Pokémon's moveset.Gets the Pokémon's Nature.net.minecraft.network.chat.MutableComponent
boolean
Gets all Pokémon on the opposite side of the battle.Gets the name of the Pokémon's original Trainer.net.minecraft.network.chat.MutableComponent
Returns the Pokémon's battle participant.int
getPercentMaxHealth
(float percent) int
getPercentMaxHealth
(float percent, boolean ignoreDynamax) Gets an amount of the Pokémon's maximum hp from a percentage.net.minecraft.server.level.ServerPlayer
Gets the player who owns the Pokémon.Gets the Pokémon's pokemonLevel container.int
Gets the Pokémon's pokemonLevel.Gets the Pokémon's unlocalized pokemon name.Gets the ID of the Pokémon.Gets the previous form.Returns the Pokémon's non-volatile status.net.minecraft.network.chat.MutableComponent
Gets the Pokémon's nickname, ignoring Illusion.Gets the Pokémon's pokemon.getStats()
Gets the Pokémon's stat numbers.getStatus
(int i) Returns the Pokémon's status at the specified index.getStatus
(StatusType type) Gets the specified status on the Pokémon.Returns the Pokémon's statuses.int
getStatusIndex
(StatusType findStatus) Returns the index of the status.int
Returns the number of statuses the Pokémon has.getTargets
(Attack chosenAttack) Randomly selects targets for an attack.Gets all Pokémon on this Pokémon's side of the battle.Gets all Pokémon on this Pokémon's side of the battle excluding itself.getTypes()
Fetches the pokémon's types, including the added type.getTypes
(boolean excludeAdded) Fetches the pokémon's types.Gets the type of the item the Pokémon is holding if it is currently usable.float
getWeight
(boolean ignoreAbility) Returns the Pokémon's weight, factoring in modifications from other sources.net.minecraft.world.level.Level
getWorld()
Gets the world that the Pokémon is in.net.minecraft.core.BlockPos
Gets the world position of the Pokémon.boolean
boolean
hasActiveAbilityShield
(boolean announce) boolean
hasAllStatuses
(StatusType... statuses) Checks if the Pokémon has all of the specified statuses.boolean
hasAllTypes
(Element... types) Checks if a pokemon has all of the requested types.boolean
hasAnyStatusPreventingAttack
(PixelmonWrapper attacker) Checks if the Pokémon has any status blocking the attacker's current attack.boolean
Checks if the Pokémon is holding a Mega Stone that it can Mega Evolve with.static boolean
hasCompatibleMegaStone
(HeldItem heldItem, Stats form) Checks if a Pokémon is holding a Mega Stone that it can Mega Evolve with.boolean
Checks if the Pokémon is at full health.boolean
hasFullHealth
(boolean ignoreAbility) Checks if the Pokémon is at full health.boolean
Gets the Gigantamax Factor of the Pokémon.boolean
Checks if the Pokémon has a held item.boolean
hasMoved()
Checks if the Pokémon has already moved during the turn.boolean
Returns whether the Pokémon has a non-volatile status.boolean
hasNonVolatileStatus
(boolean includeComatose) Returns whether the Pokémon has a non-volatile status.boolean
Checks if the Pokémon has a special item that cannot be removed in battle by the given user.boolean
hasStatus
(StatusType... statuses) Checks if the Pokémon has any of the specified statuses.boolean
hasSubstituteBlockingAttacker
(PixelmonWrapper attacker) Checks if the Pokémon has a Substitute that can block the attacking pokemonboolean
Checks if the Pokémon's type is one of a list of types.void
heal()
Heals the Pokémon to full health, clears all status effects, and restores all PP.int
healByPercent
(float percent) Heals the Pokémon by a certain percentage of its maximum health.int
healEntityBy
(int i) Heals a Pokémon by a specified amount.boolean
Checks if the Pokémon is airborne, preventing Ground-type attacks from hitting it.boolean
isAlive()
Returns whether the Pokémon can battle.boolean
isAlly
(PixelmonWrapper pokemon) boolean
isAllyNotSelf
(PixelmonWrapper pokemon) boolean
boolean
Returns whether the Pokémon is fainted.boolean
Checks if it is the first turn that the Pokémon has been out.boolean
boolean
Determines whether the Pokémon is grounded by an effect, negating being airborne.boolean
Checks if the Pokémon is immune to powder moves.boolean
isItemGivable
(HeldItem item) Checks if this held item can be given to this pokemon during battle.boolean
Checks if this Pokémon's held item can be removed during battle.boolean
Checks if the pokemon is moving last of everyone this turn.boolean
isOpponent
(PixelmonWrapper pokemon) boolean
Gets whether this is a raid Pokémon.boolean
isSameTeam
(PixelmonWrapper other) Checks if a Pokémon is on the same team as this Pokémon.boolean
Checks if the Pokémon is in a semi-invulnerable state.boolean
Checks if the Pokémon is a single-typed Pokémon.boolean
isSingleType
(Element type) Checks if the Pokémon is a single-typed Pokémon of a certain type.boolean
Gets whether this is a wild Pokémon.boolean
Mega Evolves the Pokémon.void
boolean
reducePP
(boolean reducePP, boolean affectPP) Reduce the Power Points (PP) of a move after it has been used.boolean
Register a Z-Move as used after it has been used.void
Removes the Pokémon's held item.Removes the Pokémon's non-volatile status and returns it.removePrimaryStatus
(boolean showMessage) Removes the Pokémon's non-volatile status and returns it.void
removeStatus
(int i) Removes the status at the specified index.void
Removes the status from the Pokémon.void
removeStatus
(StatusBase e, boolean showMessage) Removes the status from the Pokémon.boolean
Removes the specified status from the Pokémon.boolean
removeStatus
(StatusType s, boolean message) Removes the specified status from the Pokémon.boolean
removeStatuses
(boolean showMessage, StatusType... statuses) Removes the specified statuses from the Pokémon.boolean
removeStatuses
(StatusType... statuses) Removes the specified statuses from the Pokémon.boolean
removeTeamStatus
(StatusBase status) Removes a team status from Pokémon on this Pokémon's side of the field.boolean
removeTeamStatus
(StatusType... statuses) Removes team statuses from Pokémon on this Pokémon's side of the field.boolean
removeType
(Element type) Removes a given element from the base types.void
Resets a Mega and Ash-Greninja Evolved Pokémon back to their base form.void
Resets Pokémon attributes when switching.void
Returns the Pokémon to where it was at the start of the battle.void
Saves all the data on this attack to the info for the previous attack.void
Decides what action the AI will take during battle.void
sendStatusPacket
(int statusID) Sends a status update to the client.void
setAttack
(int buttonId, List<PixelmonWrapper> targets, boolean megaEvolving) Sets the Pokémon's attack to the button pressed.void
setAttack
(Attack attack, List<PixelmonWrapper> targets, boolean willEvolve) Sets the Pokémon's attack to an attack.void
Marks the Pokémon's current attack as failed.void
setBasePosition
(double[] ds) Sets the Pokémon's initial position.void
setConsumedItem
(HeldItem heldItem) Sets the Pokémon's most recent consumed item.void
setExp
(int experience) Sets the Pokémon's experience.void
Sets the form of a Pokémon.void
Sets the form of a Pokémon.void
setHealth
(int newHP) Sets the Pokémon's current hp.void
setHealthPercentage
(float percentage) Sets the Pokemon's health to a certain percentage of its maximum health.void
setHeldItem
(HeldItem newItem) Sets the Pokémon's held item.void
setHeldItem
(net.minecraft.world.item.ItemStack itemStack) Sets the Pokémon's held item.void
setLevelNum
(int level) Sets the Pokémon's pokemonLevel.void
setMoved
(boolean moved) Sets if the Pokémon has already moved during the turn.void
setMoveTargets
(PixelmonWrapper... pokemon) Sets the targets of the Pokémon's attack.void
setNewHeldItem
(HeldItem heldItem) Sets a new held item for the Pokémon during battle.void
setPalette
(String paletteName) Sets the palette of a Pokémon.void
setPrevForm
(Stats form) Sets the previous form.void
setPrevForm
(String form) Sets the previous form.void
setPrevPaletteName
(String paletteName) Sets the palette of a Pokémon.void
setRaidShields
(int shields) void
setStatus
(int i, StatusBase newStatus) Changes a status into a different status.void
setStruggle
(List<PixelmonWrapper> targets) Sets the Pokémon's attack to Struggle.boolean
setTempAbility
(Ability newAbility) Sets a temporary Ability for the Pokémon if its Ability changes during battle.boolean
setTempAbility
(Ability newAbility, boolean formChange) Sets a temporary Ability for the Pokémon if its Ability changes during battle.void
setTempLevel
(int level) Sets a temporary pokemonLevel for the Pokémon to use in battle.void
setTemporaryMoveset
(Moveset moveset) boolean
setTempType
(Element newType) Sets a temporary type for the Pokémon if it changes during battle.boolean
setTempType
(List<Element> newType) Sets type for the Pokémon if it changes during battle.void
Sets up variables for the Pokémon to switch out due to a move.boolean
boolean
Checks if the turn is skipped for the Pokémonboolean
Checks if the Pokémon prevents being forced outvoid
suppressType
(Element type) boolean
Switches the Pokémon for start-of-turn switches.void
takeTurn()
Does the Pokémon's action for the turn.targetNewNonFaintedPokemon
(List<PixelmonWrapper> correctedTargets, PixelmonWrapper target) .void
targetNewPokemonSwitchedIn
(List<PixelmonWrapper> correctedTargets, PixelmonWrapper target) In the event that this Pokémon is somehow targeting a Pokémon that is no longer on the battlefield, such as due to being switched out by an Eject Button or an Eject Pack, switch the target to the new Pokémon that is in the same position on the same side of the field.toString()
void
turnTick()
Handles end-of-turn effects.void
undoSuppressedType
(Element type) void
update
(EnumUpdateType... types) Updates the Pokémon client-side.void
updateBattleDamage
(int damage) Updates the client with changes to the Pokémon's health in battle.void
Updates Pokémon in battle.void
updateRaidShields
(int shields) void
Uses an attack and processes the results of the attack.void
useAttack
(boolean affectPP) Uses an attack and processes the results of the attack.Uses an attack without doing anything else.void
useItem()
Uses an item on the Pokémon.void
useTempAttack
(Attack tempAttack) Used if the attack used was called by another attack.void
useTempAttack
(Attack tempAttack, PixelmonWrapper target) Used if the attack used was called by another attack.void
useTempAttack
(Attack tempAttack, List<PixelmonWrapper> targets) Used if the attack used was called by another attack.void
useTempAttack
(Attack tempAttack, List<PixelmonWrapper> targets, boolean affectPP) Used if the attack used was called by another attack.void
useTempAttack
(Attack tempAttack, List<PixelmonWrapper> targets, boolean affectPP, boolean bypassesFlinch) Used if the attack used was called by another attack.void
void
Saves the battling Pokémon's data to NBT.
-
Field Details
-
entity
The Pokémon wrapped by this wrapper. Can be null if the Pokémon is not currently sent out. -
pokemon
The Pokemon object underlying this wrapper. -
initialCopyOfPokemon
-
participant
The participant who owns this Pokémon. -
bc
The battle controller for the battle the Pokémon is in. -
attack
The Pokémon's current attack. -
selectedAttack
The attack the Pokémon selected for the turn. Used for moves that call other moves. -
lastAttack
The Pokémon's previous attack. -
lastSimulatedAttack
The Pokémon's previous attack that the AI simulated. -
lastTempAttack
The Pokémon's previous temp attack. -
lastSimulatedTempAttack
The Pokémon's previous temp attack that the AI simulated. -
lastTargets
-
lastSimulatedTargets
-
targetIndex
public int targetIndexThe index of the current target of an attack when iterating through targets. -
attackSucceeded
public boolean attackSucceededWhether the last attack this pokemon performed succeeded. -
usedMoves
The moves used by the Pokémon since it last entered battle. -
escapeAttempts
public int escapeAttemptsThe number of times the Pokémon has attempted to escape in the battle. -
damageTakenThisTurn
public int damageTakenThisTurnThe amount of damage the Pokémon has taken in the turn. -
amountOfTimesHit
public int amountOfTimesHitThe amount of times the Pokémon has taken an instance of damage over the entire battle. -
priority
public float priorityThe Pokémon's priority in the turn. -
canAttack
public boolean canAttackWhether the Pokémon can attack in the turn. -
willTryFlee
public boolean willTryFleeWhether the Pokémon will try to flee in the turn. -
isSwitching
public boolean isSwitchingWhether the Pokémon is switching in the turn. -
willEvolve
public boolean willEvolveWhether the Pokémon will evolve during the turn. -
nextSwitchIsMove
public boolean nextSwitchIsMoveWhether the Pokémon is switching out because of the effects of a move. -
willUseItemPokemon
The UUID of the Pokémon. -
willUseItemInStack
public net.minecraft.world.item.ItemStack willUseItemInStackThe item that is being used on the Pokémon. -
willUseItemInStackInfo
public int willUseItemInStackInfoAn additional argument for the item used on the Pokémon. -
hasBeenInBattle
public boolean hasBeenInBattleWhether the Pokémon has already been in this battle. -
isTempAttack
public boolean isTempAttackWhether the Pokémon is performing a called move. -
wait
public boolean waitWhether the Pokémon is currently waiting for other combatants to make a move in battle. -
onBattlefield
public boolean onBattlefieldWhether the Pokémon is fighting on the field of battle instead of in the party. -
battlePosition
public int battlePositionThe Pokémon's position in battle. -
tempAbility
The temporary Ability of the Pokémon if it is changed. -
temporaryMoveset
-
targets
The targets of the Pokémon's attack. -
newPokemonUUID
The Pokémon that this Pokémon will switch into. -
inMultipleHit
public boolean inMultipleHitWhether the user is in the middle of a multi-hit move. -
inParentalBond
public boolean inParentalBondWhether the user is on the first hit of Parental Bond. -
inReflection
public boolean inReflectionWhether the user is using a reflected move. -
isDelayedActivation
public boolean isDelayedActivationWhether the user is waiting to activate an effect. -
protectsInARow
public int protectsInARowThe number of times the Pokémon has successfully used Protect (or similar moves) in a row. -
allySwitchInARow
public int allySwitchInARowThe number of times the Pokémon has successfully used AllySwitch in a row. -
hasAwardedExp
public boolean hasAwardedExpWhether the Pokémon has awarded experience upon fainting. -
switchedThisTurn
public boolean switchedThisTurnWhether the Pokémon switched in during the current turn. -
switchedLastTurn
public boolean switchedLastTurnWhether the Pokémon switched in during the previous turn. -
evolvedThisTurn
public boolean evolvedThisTurnWhether the Pokémon mega evolved/dynamaxed during this turn. -
faintedAtEndOfTurn
public boolean faintedAtEndOfTurnWhether the Pokémon fainted due to end of turn effects. -
changeBurmy
public boolean changeBurmyWhether the Pokémon is a Burmy that should change form after the battle. -
choiceLocked
The attack that a choice item has restricted the holder to. -
choiceSwapped
public boolean choiceSwappedWhether the Pokémon's choice item was just swapped with another. -
metronomeBoost
public int metronomeBoostThe current boost from a Metronome held item. -
ejectPackCanActivate
public boolean ejectPackCanActivateWhether this Eject Pack can activate from a stat being lowered. Used to check that this Eject Pack should be used when multiple Eject Packs can activate. -
eatenBerry
public boolean eatenBerryWhether the Pokémon has eaten a Berry during the battle. -
eatingBerry
public boolean eatingBerryWhether the Pokémon is currently eating a Berry to cure status. -
forceEatingBerry
public boolean forceEatingBerryWhether the Pokémon is currently eating a Berry regardless of benefits -
lastDirectDamage
public int lastDirectDamageThe amount of direct damage that was dealt the last time the Pokémon was attacked in the current turn. -
lastHP
public int lastHPThe amount of HP this pokemon had before recieving damage. -
beginingOfTurnHP
protected int beginingOfTurnHP -
lastDirectCategory
The damage category of the last direct damage that was dealt the Pokémon was attacked in the current turn. -
lastDirectPosition
public int lastDirectPositionThe last position of the Pokémon in the battle. -
evolution
The query used to Mega Evolve the Pokémon. -
temporaryPokemonLevel
-
type
The Pokémon's type. -
addedType
A temporary type added to the Pokémon. -
initialType
The original type of the Pokémon. -
suppressedTypes
The Pokémon's type. -
isMega
public boolean isMegaWhether the Pokémon is Mega Evolved. -
isDynamax
public int isDynamaxWhether the Pokémon is Dynamaxed (1)/Gigantamaxed (2). -
dynamaxTurns
public int dynamaxTurns -
prevForm
-
prevPaletteName
-
animateHP
public boolean animateHPWhether to animate hp changes client-side. -
usingZ
public boolean usingZWhether or not the Pokémon is using a Z-Move. -
usingZPower
public boolean usingZPower -
zMove
-
ignoringZCrystal
public boolean ignoringZCrystal -
skipZConvert
public boolean skipZConvert -
shields
public int shieldsBarriers for Raid Pokémon. Setting these values outside of a Raid is undefined behaviour, and probably won't do anything. -
maxShields
public int maxShields
-
-
Constructor Details
-
PixelmonWrapper
Constructs the wrapper.- Parameters:
participant
- The battle participant owning the Pokémon.entity
- The Pokémon wrapped by the wrapper.
-
PixelmonWrapper
-
PixelmonWrapper
-
PixelmonWrapper
Constructs up the wrapper.- Parameters:
participant
- The battle participant owning the Pokémon.pixelmon
- The Pokémon wrapped by the wrapper.bc
- The battle controller of the battle the Pokémon is in.
-
PixelmonWrapper
Constructs the wrapper.- Parameters:
participant
- The battle participant owning the Pokémon.pokemon
- The Pokemon data of the Pokémon wrapped by the wrapper.
-
PixelmonWrapper
Makes a deep copy of the PixelmonWrapper object- Parameters:
pw
- The Pokémon that is being assigned
-
-
Method Details
-
getStats
Gets the Pokémon's stat numbers.- Returns:
- The Pokémon's stat numbers.
-
getBattleStats
Gets the Pokémon's stats and stat modifiers.- Returns:
- The Pokémon's stats and stat modifiers.
-
getCritStage
public int getCritStage() -
getInitialType
Gets the original type of the Pokémon if it is changed.- Returns:
- The original type of the Pokémon if it is changed.
-
getFriendship
public int getFriendship()Gets the object that tracks friendship.- Returns:
- The object that tracks friendship.
-
getAttackers
Gets Pokémon that this Pokémon has faced during battle.- Returns:
- A set of Pokémon that this Pokémon has faced during battle.
-
getPokerus
-
getTypes
Fetches the pokémon's types, including the added type.- Returns:
- A list of the pokémon's types.
-
getTypes
Fetches the pokémon's types.- Parameters:
excludeAdded
- Whether to include the tertiary added type in the list.- Returns:
- A list of the pokémon's types.
-
getBaseTypes
Fetches the pokémon's base types, ignoring added and suppressed types.- Returns:
- A list of the pokémon's types.
-
hasType
Checks if the Pokémon's type is one of a list of types.- Parameters:
types
- The types to compare the Pokémon's types against.- Returns:
- Whether the Pokémon's type is one of a list of types.
-
hasAllTypes
Checks if a pokemon has all of the requested types.- Returns:
- Whether the pokemon has all of the requested types.
-
addType
Sets the tertiary added type.- Returns:
- Whether setting the added type was successful.
-
getAddedType
Returns the tertiary added type. -
suppressType
-
undoSuppressedType
-
isSingleType
public boolean isSingleType()Checks if the Pokémon is a single-typed Pokémon.- Returns:
- Whether the Pokémon is a single-typed Pokémon.
-
isSingleType
Checks if the Pokémon is a single-typed Pokémon of a certain type.- Parameters:
type
- The type to check for.- Returns:
- Whether the Pokémon is a single-typed Pokémon of a certain type.
-
removeType
Removes a given element from the base types.- Parameters:
type
- The element to remove from the types.- Returns:
- Whether the type removal worked.
-
setTempType
Sets a temporary type for the Pokémon if it changes during battle.- Parameters:
newType
- The Pokémon's new temporary type.
-
setTempType
Sets type for the Pokémon if it changes during battle.- Parameters:
newType
- The Pokémon's new type.
-
clearTurnVariables
public void clearTurnVariables()Resets variables that keep track of aspects within turns. -
setMoveTargets
Sets the targets of the Pokémon's attack.- Parameters:
pokemon
- The targeted Pokémon.
-
selectAIAction
public void selectAIAction()Decides what action the AI will take during battle. -
skipsTurn
public boolean skipsTurn()Checks if the turn is skipped for the Pokémon- Returns:
- If the turn should be skipped
-
canEvolve
public boolean canEvolve() -
stopsForcedSwitches
Checks if the Pokémon prevents being forced out- Returns:
- If the Pokémon prevents being forced to switch
-
chooseMove
public void chooseMove()Chooses a move to use depending on the AI. -
chooseMove
Prepares a move based on a move choice.- Parameters:
moveChoice
- The move choice to prepare a move with.
-
getTargets
Randomly selects targets for an attack.- Parameters:
chosenAttack
- The attack to find targets for.- Returns:
- An ArrayList containing the targets for the attack.
-
useAttack
public void useAttack()Uses an attack and processes the results of the attack. -
useAttack
public void useAttack(boolean affectPP) Uses an attack and processes the results of the attack.- Parameters:
affectPP
- Whether PP should be deducted after the attack is used.
-
targetNewNonFaintedPokemon
public List<PixelmonWrapper> targetNewNonFaintedPokemon(List<PixelmonWrapper> correctedTargets, PixelmonWrapper target) . In the event this Pokémon only has one target, attempt to find a new target on the enemy team, but only if the enemy team was the targeted team in the first place.- Parameters:
correctedTargets
- A list of the Pokémon that will be the new target(s).
-
targetNewPokemonSwitchedIn
public void targetNewPokemonSwitchedIn(List<PixelmonWrapper> correctedTargets, PixelmonWrapper target) In the event that this Pokémon is somehow targeting a Pokémon that is no longer on the battlefield, such as due to being switched out by an Eject Button or an Eject Pack, switch the target to the new Pokémon that is in the same position on the same side of the field.- Parameters:
correctedTargets
- A list of the Pokémon that will be the new target(s).
-
savePreviousAttackValues
public void savePreviousAttackValues()Saves all the data on this attack to the info for the previous attack. -
reducePP
public boolean reducePP(boolean reducePP, boolean affectPP) Reduce the Power Points (PP) of a move after it has been used.- Parameters:
reducePP
- Whether the move reduces PP.affectPP
- Whether the PP will be reduced this turn.- Returns:
- Returns true if the attack's pp was reduced.
-
registerZMove
public boolean registerZMove()Register a Z-Move as used after it has been used.- Returns:
- Whether the game attempted to register a Z-Move.
-
useAttackOnly
Uses an attack without doing anything else.- Returns:
- An array of results of the attack.
-
useItem
public void useItem()Uses an item on the Pokémon. -
useTempAttack
Used if the attack used was called by another attack.- Parameters:
tempAttack
- The attack to use.
-
useTempAttack
Used if the attack used was called by another attack.- Parameters:
tempAttack
- The attack to use.target
- The target of the attack.
-
useTempAttack
Used if the attack used was called by another attack.- Parameters:
tempAttack
- The attack to use.targets
- The targets of the attack.
-
useTempAttack
Used if the attack used was called by another attack.- Parameters:
tempAttack
- The attack to use.targets
- The targets of the attack.
-
useTempAttack
public void useTempAttack(Attack tempAttack, List<PixelmonWrapper> targets, boolean affectPP, boolean bypassesFlinch) Used if the attack used was called by another attack.- Parameters:
tempAttack
- The attack to use.targets
- The targets of the attack.
-
turnTick
public void turnTick()Handles end-of-turn effects. -
endTurn
public void endTurn() -
getParticipant
Returns the Pokémon's battle participant.- Returns:
- The Pokémon's battle participant.
-
doSwitch
Handles switching.- Returns:
- The Pokémon who switched in.
-
beforeSwitch
Handles effects that occur just before switching out. -
afterSwitch
public void afterSwitch() -
afterSwitch
Handles effects that occur just after switching out. -
switchThisTurn
public boolean switchThisTurn()Switches the Pokémon for start-of-turn switches. Move based switches are handled in their move effects instead.- Returns:
- Whether the Pokémon is switching this turn.
-
findPixelmon
-
forcePursuitAttackers
public void forcePursuitAttackers()Force a Pokémon targeting the current Pokémon with Pursuit to attack. -
takeTurn
public void takeTurn()Does the Pokémon's action for the turn. -
dynamax
public boolean dynamax(boolean revert, float healthPercentage) -
megaEvolve
public boolean megaEvolve()Mega Evolves the Pokémon. -
canAttackThisTurn
-
setAttack
Sets the Pokémon's attack to the button pressed.- Parameters:
buttonId
- The ID of the pressed button.targets
- The attack's targets.megaEvolving
- Whether the Pokémon will Mega Evolve when using the attack.
-
setAttack
Sets the Pokémon's attack to an attack.- Parameters:
attack
- The attack to be used.targets
- The attack's target.willEvolve
- Whether the Pokémon will evolve(Mega, ultraburst, dynamax) when using the attack.
-
isFainted
public boolean isFainted()Returns whether the Pokémon is fainted.- Returns:
- Whether the Pokémon is fainted.
-
isAlive
public boolean isAlive()Returns whether the Pokémon can battle.- Returns:
- Whether the Pokémon can battle.
-
setStruggle
Sets the Pokémon's attack to Struggle.- Parameters:
targets
- The targets of Struggle.
-
returnToBasePos
public void returnToBasePos()Returns the Pokémon to where it was at the start of the battle. -
setBasePosition
public void setBasePosition(double[] ds) Sets the Pokémon's initial position.- Parameters:
ds
- The initial position.
-
setTempAbility
Sets a temporary Ability for the Pokémon if its Ability changes during battle.- Parameters:
newAbility
- The Ability for the Pokémon to receive.- Returns:
- Whether the new ability has been set.
-
setTempAbility
Sets a temporary Ability for the Pokémon if its Ability changes during battle.- Parameters:
newAbility
- The Ability for the Pokémon to receive.formChange
- Whether the Ability is the result of a form change.- Returns:
- Whether the new ability has been set.
-
resetOnSwitch
public void resetOnSwitch()Resets Pokémon attributes when switching. -
getWeight
public float getWeight(boolean ignoreAbility) Returns the Pokémon's weight, factoring in modifications from other sources.- Parameters:
ignoreAbility
- Whether to ignore the Pokémon's Ability when calculating weight.- Returns:
- The Pokémon's weight.
-
consumeItem
public void consumeItem()Consumes the Pokémon's held item. -
setConsumedItem
Sets the Pokémon's most recent consumed item.- Parameters:
heldItem
- The consumed held item.
-
getConsumedItem
Returns the Pokémon's most recent consumed held item.- Returns:
- The Pokémon's most recent consumed held item, or null if there isn't one.
-
setNewHeldItem
Sets a new held item for the Pokémon during battle.- Parameters:
heldItem
- The new held item for the Pokémon.
-
isGrounded
public boolean isGrounded()Determines whether the Pokémon is grounded by an effect, negating being airborne.- Returns:
- Whether the Pokémon is grounded.
-
isAirborne
public boolean isAirborne()Checks if the Pokémon is airborne, preventing Ground-type attacks from hitting it.- Returns:
- Whether the Pokémon is airborne.
-
isSemiInvulnerable
public boolean isSemiInvulnerable()Checks if the Pokémon is in a semi-invulnerable state.- Returns:
- Whether the Pokémon is semi-invulnerable.
-
addTeamStatus
Adds a team status to all Pokémon on this Pokémon's side of the field.- Parameters:
status
- The status to add.cause
- The Pokémon who caused the status to occur.- Returns:
- Whether the status was added successfully.
-
removeTeamStatus
Removes a team status from Pokémon on this Pokémon's side of the field.- Parameters:
status
- The status to remove.
-
removeTeamStatus
Removes team statuses from Pokémon on this Pokémon's side of the field.- Parameters:
statuses
- The statuses to remove.
-
getTeamPokemon
Gets all Pokémon on this Pokémon's side of the battle.- Returns:
- A list of all Pokémon on this Pokémon's side of the battle.
-
getTeamPokemonExcludeSelf
Gets all Pokémon on this Pokémon's side of the battle excluding itself.- Returns:
- A list of all Pokémon on this Pokémon's side of the battle excluding itself.
-
getOpponentPokemon
Gets all Pokémon on the opposite side of the battle.- Returns:
- A list of all Pokémon on the opposite side of the battle.
-
isAlly
-
isAllyNotSelf
-
isOpponent
-
getControlledIndex
public int getControlledIndex()Returns the index of the Pokémon in its participant's controlled Pokémon array.- Returns:
- The index of the Pokémon in its participant's controlled Pokémon array, or -1 if the Pokémon is not found.
-
getBattleAI
Gets the battle AI of the Pokémon's participant.- Returns:
- The battle AI of the Pokémon's participant.
-
setUpSwitchMove
public void setUpSwitchMove()Sets up variables for the Pokémon to switch out due to a move. -
forceRandomSwitch
Randomly switches the Pokémon out for another.- Parameters:
switchPokemon
- The Pokémon replacing this Pokémon.
-
isImmuneToPowder
public boolean isImmuneToPowder()Checks if the Pokémon is immune to powder moves.- Returns:
- Whether the Pokémon is immune to powder moves.
-
toString
-
equals
-
setMoved
public void setMoved(boolean moved) Sets if the Pokémon has already moved during the turn. -
hasMoved
public boolean hasMoved()Checks if the Pokémon has already moved during the turn.- Returns:
- Whether the Pokémon has already moved during the turn.
-
isFirstTurn
public boolean isFirstTurn()Checks if it is the first turn that the Pokémon has been out.- Returns:
- Whether it is the first turn that the Pokémon has been out.
-
isMovingLast
public boolean isMovingLast()Checks if the pokemon is moving last of everyone this turn.- Returns:
- Whether the user is the last one to move.
-
isSameTeam
Checks if a Pokémon is on the same team as this Pokémon.- Parameters:
other
- The Pokémon to check.- Returns:
- Whether the Pokémon is on the same team as this Pokémon.
-
getMoveset
Returns the Pokémon's moveset. If the Pokémon has a temporary moveset due to an in-battle effect, the temporary moveset is returned.- Returns:
- The Pokémon's moveset.
-
setTemporaryMoveset
-
validateAction
- Throws:
BattleException
-
removeStatus
Removes the specified status from the Pokémon.- Parameters:
s
- The status to remove.- Returns:
- Whether the Pokémon had the status to begin with.
-
removeStatus
Removes the specified status from the Pokémon.- Parameters:
s
- The status to remove.message
- Whether to send message or not.- Returns:
- Whether the Pokémon had the status to begin with.
-
removeStatuses
Removes the specified statuses from the Pokémon.- Parameters:
statuses
- The statuses to remove.- Returns:
- Whether a status was removed.
-
removeStatuses
Removes the specified statuses from the Pokémon.- Parameters:
showMessage
- Whether to show messages when statuses are removed.statuses
- The statuses to remove.- Returns:
- Whether a status was removed.
-
removeStatus
public void removeStatus(int i) Removes the status at the specified index.- Parameters:
i
- The index of the status to remove.
-
getStatus
Gets the specified status on the Pokémon.- Parameters:
type
- The status to get.- Returns:
- The corresponding status, or null if the Pokémon doesn't have the status.
-
hasStatus
Checks if the Pokémon has any of the specified statuses.- Parameters:
statuses
- The statuses to check.- Returns:
- Whether the Pokémon has any of the statuses.
-
hasAllStatuses
Checks if the Pokémon has all of the specified statuses.- Parameters:
statuses
- The statuses to check.- Returns:
- Whether the Pokémon has any of the statuses.
-
hasAnyStatusPreventingAttack
Checks if the Pokémon has any status blocking the attacker's current attack.- Parameters:
attacker
- The pokemon attacking this one.- Returns:
- Whether the Pokémon has any status blocking the attack.
-
hasNonVolatileStatus
public boolean hasNonVolatileStatus()Returns whether the Pokémon has a non-volatile status.- Returns:
- Whether the Pokémon has a non-volatile status.
-
hasNonVolatileStatus
public boolean hasNonVolatileStatus(boolean includeComatose) Returns whether the Pokémon has a non-volatile status.- Parameters:
includeComatose
- Whether Comatose is valid or not for this.- Returns:
- Whether the Pokémon has a non-volatile status.
-
countStatuses
Counts the number of statuses from a list that the Pokémon has.- Parameters:
statuses
- The statuses to take into account when counting.- Returns:
- The number of statuses from the given list that the Pokémon has.
-
getStatusSize
public int getStatusSize()Returns the number of statuses the Pokémon has.- Returns:
- The number of statuses the Pokémon has.
-
getStatuses
Returns the Pokémon's statuses.- Returns:
- The Pokémon statuses as a list.
-
getStatus
Returns the Pokémon's status at the specified index.- Parameters:
i
- The index of the status.- Returns:
- The status at index i.
-
getStatusIndex
Returns the index of the status.- Parameters:
findStatus
- The status to get the index of.- Returns:
- The index of the status, or -1 if the Pokémon does not have the status.
-
getPrimaryStatus
Returns the Pokémon's non-volatile status.- Returns:
- The Pokémon's non-volatile status, or null if the Pokémon does not have one.
-
setStatus
Changes a status into a different status.- Parameters:
i
- The index of the old status.newStatus
- The status to turn the old status into.
-
clearStatus
public void clearStatus()Removes all statuses from the Pokémon. -
addStatus
Adds a status to the Pokémon.- Parameters:
e
- The status to add.opponent
- The Pokémon who caused the status.- Returns:
- Whether the status was successfully added.
-
addStatus
public boolean addStatus(StatusBase e, PixelmonWrapper opponent, net.minecraft.network.chat.MutableComponent message) Adds a status to the Pokémon.- Parameters:
e
- The status to add.opponent
- The Pokémon who caused the status.message
- The message to display when the status is added.- Returns:
- Whether the status was successfully added.
-
sendStatusPacket
public void sendStatusPacket(int statusID) Sends a status update to the client.- Parameters:
statusID
- The ID of the status to add, or -1 to remove it.
-
removeStatus
Removes the status from the Pokémon.- Parameters:
e
- The status to remove.
-
removeStatus
Removes the status from the Pokémon.- Parameters:
e
- The status to remove.
-
removePrimaryStatus
Removes the Pokémon's non-volatile status and returns it.- Returns:
- The Pokémon's former non-volatile status, or null if it did not have one.
-
removePrimaryStatus
Removes the Pokémon's non-volatile status and returns it.- Parameters:
showMessage
- Whether to show a message when a status is cured.- Returns:
- The Pokémon's former non-volatile status, or null if it did not have one.
-
cannotHaveStatus
Checks whether the Pokémon can receive the status.- Parameters:
t
- The status to check.opponent
- The Pokémon causing the status.- Returns:
- Whether the Pokémon can receive the status.
-
cannotHaveStatus
public boolean cannotHaveStatus(StatusBase t, PixelmonWrapper opponent, boolean ignorePrimaryOverlap) Checks whether the Pokémon can receive the status.- Parameters:
t
- The status to check.opponent
- The Pokémon causing the status.ignorePrimaryOverlap
- Whether to ignore the restriction that primary statuses cannot overlap with each other.- Returns:
- Whether the Pokémon can receive the status.
-
getEntryHazards
Gets the entry hazards on the Pokémon's side of the field.- Returns:
- A list of the entry hazards on the Pokémon's side of the field.
-
updateBattleDamage
public void updateBattleDamage(int damage) Updates the client with changes to the Pokémon's health in battle.- Parameters:
damage
- The damage that was dealt to the Pokémon.
-
getEffectiveTypes
Modifies the Pokémon's type to calculate type effectiveness if there are statuses that do so.- Parameters:
user
- The attack's user.target
- The attack's target.- Returns:
- The target's type after applying the statuses.
-
doBattleDamage
Damages the Pokémon in battle.- Parameters:
source
- The Pokémon who caused the damage.damage
- The amount of damage to deal.damageType
- The type of damage that is to be dealt.- Returns:
- The amount of damage dealt.
-
getAbility
Gets the Pokémon's Ability.- Returns:
- The Pokémon's Ability.
-
getBattleAbility
Gets the Pokémon's active Ability in battle.- Returns:
- The Pokémon's active Ability in battle.
-
getBattleAbility
Gets the Pokémon's Ability in battle.- Parameters:
moveUser
- The Pokémon using a move on this Pokémon.- Returns:
- The Pokémon's Ability in battle.
-
getBattleAbility
Gets the Pokémon's Ability in battle.- Parameters:
canIgnore
- Whether to acknowledge if the Pokémon's Ability is inactive.- Returns:
- The Pokémon's Ability in battle.
-
getBattleAbility
Gets the Pokémon's Ability in battle.- Parameters:
canIgnore
- Whether to acknowledge if the Pokémon's Ability is inactive.moveUser
- The Pokémon using a move on this Pokémon.- Returns:
- The Pokémon's Ability in battle.
-
getUnshieldedAbility
-
getBattleAbility
Gets the Pokémon's Ability in battle.- Parameters:
canIgnore
- Whether to acknowledge if the Pokémon's Ability is inactive.moveUser
- The Pokémon using a move on this Pokémon.ignoreShield
- Whether the ability's suppression can be blocked by a held Ability Shield.- Returns:
- The Pokémon's Ability in battle.
-
hasHeldItem
public boolean hasHeldItem()Checks if the Pokémon has a held item.- Returns:
- Whether the Pokémon has a held item.
-
getHeldItem
Gets the type of the item the Pokémon is holding.- Returns:
- The type of the item the Pokémon is holding.
-
getUsableHeldItem
Gets the type of the item the Pokémon is holding if it is currently usable.- Returns:
- The type of the item the Pokémon is holding if it is currently usable, or {#link NoItem} otherwise.
-
removeHeldItem
public void removeHeldItem()Removes the Pokémon's held item. -
setHeldItem
Sets the Pokémon's held item.- Parameters:
newItem
- The held item to set.
-
setHeldItem
public void setHeldItem(net.minecraft.world.item.ItemStack itemStack) Sets the Pokémon's held item.- Parameters:
itemStack
- The held item to set.
-
canMegaEvolve
public boolean canMegaEvolve()Checks if the Pokémon can Mega Evolve with its held item.- Returns:
- Whether the Pokémon can Mega Evolve with its held item.
-
canUltraBurst
public boolean canUltraBurst()Checks if the Pokémon can Ultra Burst with its held item.- Returns:
- Whether the Pokémon can Ultra Burst with its held item.
-
canDynamax
public boolean canDynamax()Checks if the Pokémon can Dynamax.- Returns:
- Whether the Pokémon can Dynamax.
-
canGigantamax
public boolean canGigantamax()Checks if the Pokémon can Gigantamax.- Returns:
- Whether the Pokémon can Gigantamax.
-
canMegaEvolve
public static boolean canMegaEvolve(net.minecraft.world.item.ItemStack heldItem, Species pokemon, String form) Checks if a Pokémon can Mega Evolve with a held item.- Parameters:
heldItem
- The Pokémon's held item.pokemon
- The Pokémon's pokemon.form
- The Pokémon's form index.- Returns:
- Whether the Pokémon can Mega Evolve with the specified held item.
-
canUseZMove
public static boolean canUseZMove(net.minecraft.world.item.ItemStack heldItem) -
canMegaEvolve
Checks if a Pokémon can Mega Evolve with a held item.- Parameters:
heldItem
- The Pokémon's held item.species
- The Pokémon's pokemon.form
- The Pokémon's form index.- Returns:
- Whether the Pokémon can Mega Evolve with the specified held item.
-
canUltraBurst
Checks if a Pokémon can Ultra Burst (Necrozma only) with a held item.- Parameters:
species
- The Pokémon's pokemon.heldItem
- The Pokémon's held item.form
- The Pokémon's form index.- Returns:
- Whether the Pokémon can Ultra Burst with the specified held item.
-
canDynamax
Checks if a Pokémon can Dynamax.- Parameters:
form
- The Pokémon's form.- Returns:
- Whether the Pokémon can Dynamax.
-
canGigantamax
Checks if a Pokémon can Gigantamax.- Parameters:
gigantamaxFactor
- The Pokémon's Gigantamax Factor.species
- The Pokémon's pokemon.form
- The Pokémon's form.- Returns:
- Whether the Pokémon can Gigantamax.
-
hasCompatibleMegaStone
public boolean hasCompatibleMegaStone()Checks if the Pokémon is holding a Mega Stone that it can Mega Evolve with.- Returns:
- Whether the Pokémon is holding a Mega Stone that it can Mega Evolve with.
-
hasCompatibleMegaStone
Checks if a Pokémon is holding a Mega Stone that it can Mega Evolve with.- Parameters:
heldItem
- The Pokémon's held item.form
- The Pokémon's form- Returns:
- Whether the Pokémon is holding a Mega Stone that it can Mega Evolve with.
-
isItemRemovable
Checks if this Pokémon's held item can be removed during battle.- Parameters:
user
- The Pokémon attempting to remove the item.- Returns:
- Whether the Pokémon's held item can be removed during battle.
-
isItemGivable
Checks if this held item can be given to this pokemon during battle. Used by Trick, Bestow, Switcheroo, Thief, Magician, Pickpocket, and Symbiosis. Should normally be paired withisItemRemovable(com.pixelmonmod.pixelmon.battles.controller.participants.PixelmonWrapper)
- Parameters:
item
- The held item being given to this Pokémon.- Returns:
- Whether the held item can be given to this Pokémon during battle.
-
hasSpecialItem
public boolean hasSpecialItem()Checks if the Pokémon has a special item that cannot be removed in battle by the given user.- Returns:
- Whether the Pokémon has a special item that cannot be removed in battle.
-
getNickname
public net.minecraft.network.chat.MutableComponent getNickname() -
getRealNickname
public net.minecraft.network.chat.MutableComponent getRealNickname()Gets the Pokémon's nickname, ignoring Illusion.- Returns:
- The Pokémon's nickname, ignoring Illusion.
-
getGender
Gets the Pokémon's gender.- Returns:
- The Pokémon's gender.
-
getHealth
public int getHealth(boolean ignoreDynamax) Returns the current hp of the Pokémon.- Parameters:
ignoreDynamax
- Whether to ignore the increase to maximum hp from Dynamax or not.- Returns:
- The current hp of the Pokémon.
-
getHealth
public int getHealth() -
getMaxHealth
public int getMaxHealth(boolean ignoreDynamax) Returns the maximum hp of the Pokémon.- Parameters:
ignoreDynamax
- Whether to ignore the increase to maximum hp from Dynamax or not.- Returns:
- The maximum hp of the Pokémon.
-
recalculateMaxHP
public void recalculateMaxHP() -
getMaxHealth
public int getMaxHealth() -
getDynamaxHealthMod
public double getDynamaxHealthMod() -
getHealthPercent
public float getHealthPercent()Returns the Pokémon's current health percentage.- Returns:
- The Pokémon's current health percentage.
-
getHealthPercent
public float getHealthPercent(float amount) Returns the Pokémon's health percentage compared to a certain amount.- Parameters:
amount
- The amount of health to get a percentage for.- Returns:
- The Pokémon's health percentage compared to the specified amount.
-
getHealPercent
public float getHealPercent(float amount) Returns the percentage of health that the Pokémon will recover from an amount.- Parameters:
amount
- The amount of health that the Pokémon can recover.- Returns:
- The percentage of health that the Pokémon will recover from the given amount.
-
getHealthDeficit
public int getHealthDeficit()Returns the difference between the Pokémon's maximum and current health.- Returns:
- The difference between the Pokémon's maximum and current health.
-
hasFullHealth
public boolean hasFullHealth(boolean ignoreAbility) Checks if the Pokémon is at full health.- Parameters:
ignoreAbility
- Whether the Pokémon's ability should be ignored for this check or not.- Returns:
- Whether the Pokémon is at full health.
-
hasFullHealth
public boolean hasFullHealth()Checks if the Pokémon is at full health.- Returns:
- Whether the Pokémon is at full health.
-
getPercentMaxHealth
public int getPercentMaxHealth(float percent, boolean ignoreDynamax) Gets an amount of the Pokémon's maximum hp from a percentage.- Parameters:
percent
- The percentage of the Pokémon's maximum hp to get.ignoreDynamax
- Whether to ignore the increase to maximum hp from Dynamax or not.- Returns:
- The amount of the Pokémon's maximum hp from a percentage.
-
getPercentMaxHealth
public int getPercentMaxHealth(float percent) -
healByPercent
public int healByPercent(float percent) Heals the Pokémon by a certain percentage of its maximum health.- Parameters:
percent
- The percentage of the Pokémon maximum health to heal it by.- Returns:
- The amount actually healed.
-
healEntityBy
public int healEntityBy(int i) Heals a Pokémon by a specified amount.- Parameters:
i
- The amount to heal the Pokémon by.- Returns:
- The amount actually healed.
-
heal
public void heal()Heals the Pokémon to full health, clears all status effects, and restores all PP. -
setHealthPercentage
public void setHealthPercentage(float percentage) Sets the Pokemon's health to a certain percentage of its maximum health.- Parameters:
percentage
- The percentage of the Pokemon's maximum health to set its health to.
-
setHealth
public void setHealth(int newHP) Sets the Pokémon's current hp.- Parameters:
newHP
- The new current hp of the Pokémon.
-
setAttackFailed
public void setAttackFailed()Marks the Pokémon's current attack as failed. -
attackMakesContact
public boolean attackMakesContact()Checks if the Pokémon's attack makes contact- Returns:
- Whether the Pokémon's attack should be treated as making contact
-
attackCanBeRedirected
public boolean attackCanBeRedirected()Checks if the Pokémon's attack can be redirected- Returns:
- Whether the Pokémon's attack can be redirected
-
hasSubstituteBlockingAttacker
Checks if the Pokémon has a Substitute that can block the attacking pokemon- Parameters:
attacker
- Pokémon that is attacking this pokémon- Returns:
- Whether this Pokémon has a substitute which will not be bypassed by the attacker's move
-
hasActiveAbilityShield
public boolean hasActiveAbilityShield() -
hasActiveAbilityShield
public boolean hasActiveAbilityShield(boolean announce) -
doesLevel
public boolean doesLevel()Checks if the Pokémon can gain experience and pokemonLevel up.- Returns:
- Whether the Pokémon can gain experience and pokemonLevel up.
-
getPokemonUUID
Gets the ID of the Pokémon.- Returns:
- The ID of the Pokémon.
-
update
Updates the Pokémon client-side.- Parameters:
types
- The types of data to update.
-
getForm
Gets the form index of the Pokémon.- Returns:
- The form index of the Pokémon.
-
setForm
Sets the form of a Pokémon.- Parameters:
form
- The index of the new form.
-
setForm
Sets the form of a Pokémon.- Parameters:
form
- The index of the new form.
-
getPrevForm
Gets the previous form. -
setPrevForm
Sets the previous form.- Parameters:
form
- The index of the previous form.
-
setPrevForm
Sets the previous form.- Parameters:
form
- The index of the previous form.
-
setPalette
Sets the palette of a Pokémon.- Parameters:
paletteName
- The name of the palette.
-
setPrevPaletteName
Sets the palette of a Pokémon.- Parameters:
paletteName
- The name of the palette.
-
hasGigantamaxFactor
public boolean hasGigantamaxFactor()Gets the Gigantamax Factor of the Pokémon.- Returns:
- The Gigantamax Factor of the Pokémon.
-
resetBattleEvolution
public void resetBattleEvolution()Resets a Mega and Ash-Greninja Evolved Pokémon back to their base form. -
getWorldPosition
public net.minecraft.core.BlockPos getWorldPosition()Gets the world position of the Pokémon.- Returns:
- The world position of the Pokémon.
-
getWorld
public net.minecraft.world.level.Level getWorld()Gets the world that the Pokémon is in.- Returns:
- The world that the Pokémon is in.
-
getPlayerOwner
public net.minecraft.server.level.ServerPlayer getPlayerOwner()Gets the player who owns the Pokémon.- Returns:
- The player who owns the Pokémon, or null if no player owns the Pokémon.
-
getOwnerName
public net.minecraft.network.chat.MutableComponent getOwnerName() -
isWildPokemon
public boolean isWildPokemon()Gets whether this is a wild Pokémon.- Returns:
- Whether this is a wild Pokémon or not.
-
isRaidPokemon
public boolean isRaidPokemon()Gets whether this is a raid Pokémon.- Returns:
- Whether this is a raid Pokémon or not.
-
addAttackers
public void addAttackers()Updates experience-gaining Pokémon to and from the Pokémon. -
getOriginalTrainer
Gets the name of the Pokémon's original Trainer.- Returns:
- The name of the Pokémon's original Trainer.
-
getPokemonName
Gets the Pokémon's unlocalized pokemon name.- Returns:
- The Pokémon's unlocalized pokemon name.
-
getSpecies
Gets the Pokémon's pokemon.- Returns:
- The Pokémon's pokemon.
-
getNature
Gets the Pokémon's Nature.- Returns:
- The Pokémon's Nature.
-
getBaseNature
Gets the Pokémon's actual Nature.- Returns:
- The Pokémon's actual Nature.
-
getPokemonLevel
Gets the Pokémon's pokemonLevel container.- Returns:
- The Pokémon's pokemonLevel container.
-
getPokemonLevelNum
public int getPokemonLevelNum()Gets the Pokémon's pokemonLevel.- Returns:
- The Pokémon's pokemonLevel.
-
getExp
public int getExp()Gets the Pokémon's experience.- Returns:
- The Pokémon's experience.
-
setLevelNum
public void setLevelNum(int level) Sets the Pokémon's pokemonLevel.- Parameters:
level
- The Pokémon's pokemonLevel.
-
setExp
public void setExp(int experience) Sets the Pokémon's experience.- Parameters:
experience
- The Pokémon's experience.
-
setTempLevel
public void setTempLevel(int level) Sets a temporary pokemonLevel for the Pokémon to use in battle.- Parameters:
level
- The pokemonLevel for the Pokémon to use.
-
getInnerLink
Gets the Pokémon stored inside this wrapper.- Returns:
- The Pokémon stored inside this wrapper.
-
enableReturnHeldItem
public void enableReturnHeldItem()Causes the Pokémon to regain a lost held item after the battle ends. -
shouldReturnHeldItem
public boolean shouldReturnHeldItem() -
writeToNBT
public void writeToNBT()Saves the battling Pokémon's data to NBT. -
updateHPIncrease
public void updateHPIncrease()Updates Pokémon in battle. -
isDynamax
public boolean isDynamax() -
isGigantamax
public boolean isGigantamax() -
setRaidShields
public void setRaidShields(int shields) -
updateRaidShields
public void updateRaidShields(int shields) -
addGlobalStatus
Adds a global statuses and allows items to catch when one is added.- Parameters:
g
- The GlobalStatusBase to be added to the battle.
-
copy
-
getBeginingOfTurnHP
public int getBeginingOfTurnHP() -
getOnBattleField
public boolean getOnBattleField()
-