Class PixelmonWrapper
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.PixelmonWrapper
Wrapper for a Pokémon in battle.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ElementA temporary type added to the Pokémon.intThe number of times the Pokémon has successfully used AllySwitch in a row.intThe amount of times the Pokémon has taken an instance of damage over the entire battle.booleanWhether to animate hp changes client-side.The Pokémon's current attack.booleanWhether the last attack this pokemon performed succeeded.intThe Pokémon's position in battle.The battle controller for the battle the Pokémon is in.protected intbooleanWhether the Pokémon can attack in the turn.booleanWhether the Pokémon is a Burmy that should change form after the battle.The attack that a choice item has restricted the holder to.booleanWhether the Pokémon's choice item was just swapped with another.intThe amount of damage the Pokémon has taken in the turn.intbooleanWhether the Pokémon has eaten a Berry during the battle.booleanWhether the Pokémon is currently eating a Berry to cure status.booleanWhether this Eject Pack can activate from a stat being lowered.The Pokémon wrapped by this wrapper.intThe number of times the Pokémon has attempted to escape in the battle.The query used to Mega Evolve the Pokémon.booleanWhether the Pokémon mega evolved/dynamaxed during this turn.booleanWhether the Pokémon fainted due to end of turn effects.booleanWhether the Pokémon is currently eating a Berry regardless of benefitsbooleanWhether the Pokémon has awarded experience upon fainting.booleanWhether the Pokémon has already been in this battle.booleanThe original type of the Pokémon.booleanWhether the user is in the middle of a multi-hit move.booleanWhether the user is on the first hit of Parental Bond.booleanWhether the user is using a reflected move.booleanWhether the user is waiting to activate an effect.intWhether the Pokémon is Dynamaxed (1)/Gigantamaxed (2).booleanWhether the Pokémon is Mega Evolved.booleanWhether the Pokémon is switching in the turn.booleanWhether 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.intThe amount of direct damage that was dealt the last time the Pokémon was attacked in the current turn.intThe last position of the Pokémon in the battle.intThe 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.intintThe current boost from a Metronome held item.The Pokémon that this Pokémon will switch into.booleanWhether the Pokémon is switching out because of the effects of a move.booleanWhether the Pokémon is fighting on the field of battle instead of in the party.protected BattleParticipantThe participant who owns this Pokémon.The Pokemon object underlying this wrapper.floatThe Pokémon's priority in the turn.intThe 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.intBarriers for Raid Pokémon.booleanThe Pokémon's type.booleanWhether the Pokémon switched in during the previous turn.booleanWhether the Pokémon switched in during the current turn.intThe 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 PokemonLevelThe Pokémon's type.The moves used by the Pokémon since it last entered battle.booleanWhether or not the Pokémon is using a Z-Move.booleanbooleanWhether the Pokémon is currently waiting for other combatants to make a move in battle.booleanWhether the Pokémon will evolve during the turn.booleanWhether the Pokémon will try to flee in the turn.net.minecraft.world.item.ItemStackThe item that is being used on the Pokémon.intAn additional argument for the item used on the Pokémon.The UUID of the Pokémon. -
Constructor Summary
ConstructorsConstructorDescriptionPixelmonWrapper(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 TypeMethodDescriptionvoidUpdates experience-gaining Pokémon to and from the Pokémon.voidAdds a global statuses and allows items to catch when one is added.booleanaddStatus(StatusBase e, PixelmonWrapper opponent) Adds a status to the Pokémon.booleanaddStatus(StatusBase e, PixelmonWrapper opponent, net.minecraft.network.chat.MutableComponent message) Adds a status to the Pokémon.booleanaddTeamStatus(StatusBase status, PixelmonWrapper cause) Adds a team status to all Pokémon on this Pokémon's side of the field.booleanSets the tertiary added type.voidvoidafterSwitch(PixelmonWrapper oldPokemon) Handles effects that occur just after switching out.booleanChecks if the Pokémon's attack can be redirectedbooleanChecks if the Pokémon's attack makes contactvoidbeforeSwitch(PixelmonWrapper switchingIn) Handles effects that occur just before switching out.booleanbooleanChecks if the Pokémon can Dynamax.static booleancanDynamax(Stats form, HeldItem item) Checks if a Pokémon can Dynamax.booleanbooleanChecks if the Pokémon can Gigantamax.static booleancanGigantamax(boolean gigantamaxFactor, Species species, Stats form) Checks if a Pokémon can Gigantamax.booleanChecks if the Pokémon can Mega Evolve with its held item.static booleancanMegaEvolve(HeldItem heldItem, Species species, String form) Checks if a Pokémon can Mega Evolve with a held item.static booleancanMegaEvolve(net.minecraft.world.item.ItemStack heldItem, Species pokemon, String form) Checks if a Pokémon can Mega Evolve with a held item.booleancannotHaveStatus(StatusBase t, PixelmonWrapper opponent) Checks whether the Pokémon can receive the status.booleancannotHaveStatus(StatusBase t, PixelmonWrapper opponent, boolean ignorePrimaryOverlap) Checks whether the Pokémon can receive the status.booleanChecks if the Pokémon can Ultra Burst with its held item.static booleancanUltraBurst(Species species, HeldItem heldItem, Stats form) Checks if a Pokémon can Ultra Burst (Necrozma only) with a held item.static booleancanUseZMove(net.minecraft.world.item.ItemStack heldItem) voidChooses a move to use depending on the AI.voidchooseMove(MoveChoice moveChoice) Prepares a move based on a move choice.voidRemoves all statuses from the Pokémon.voidResets variables that keep track of aspects within turns.voidConsumes the Pokémon's held item.copy()intcountStatuses(StatusType... statuses) Counts the number of statuses from a list that the Pokémon has.floatdoBattleDamage(PixelmonWrapper source, float damage, DamageTypeEnum damageType) Damages the Pokémon in battle.booleanChecks if the Pokémon can gain experience and pokemonLevel up.doSwitch()Handles switching.booleandynamax(boolean revert, float healthPercentage) voidCauses the Pokémon to regain a lost held item after the battle ends.voidendTurn()booleanprotected PixelmonWrapperfindPixelmon(UUID uuid) voidForce a Pokémon targeting the current Pokémon with Pursuit to attack.voidforceRandomSwitch(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.intReturns the Pokémon's most recent consumed held item.intReturns the index of the Pokémon in its participant's controlled Pokémon array.intdoublegetEffectiveTypes(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.intgetExp()Gets the Pokémon's experience.getForm()Gets the form index of the Pokémon.intGets the object that tracks friendship.Gets the Pokémon's gender.floatgetHealPercent(float amount) Returns the percentage of health that the Pokémon will recover from an amount.intintgetHealth(boolean ignoreDynamax) Returns the current hp of the Pokémon.intReturns the difference between the Pokémon's maximum and current health.floatReturns the Pokémon's current health percentage.floatgetHealthPercent(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.intintgetMaxHealth(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.MutableComponentbooleanGets all Pokémon on the opposite side of the battle.Gets the name of the Pokémon's original Trainer.net.minecraft.network.chat.MutableComponentReturns the Pokémon's battle participant.intgetPercentMaxHealth(float percent) intgetPercentMaxHealth(float percent, boolean ignoreDynamax) Gets an amount of the Pokémon's maximum hp from a percentage.net.minecraft.server.level.ServerPlayerGets the player who owns the Pokémon.Gets the Pokémon's pokemonLevel container.intGets 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.MutableComponentGets 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.intgetStatusIndex(StatusType findStatus) Returns the index of the status.intReturns 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.floatgetWeight(boolean ignoreAbility) Returns the Pokémon's weight, factoring in modifications from other sources.net.minecraft.world.level.LevelgetWorld()Gets the world that the Pokémon is in.net.minecraft.core.BlockPosGets the world position of the Pokémon.booleanbooleanhasActiveAbilityShield(boolean announce) booleanhasAllStatuses(StatusType... statuses) Checks if the Pokémon has all of the specified statuses.booleanhasAllTypes(Element... types) Checks if a pokemon has all of the requested types.booleanhasAnyStatusPreventingAttack(PixelmonWrapper attacker) Checks if the Pokémon has any status blocking the attacker's current attack.booleanChecks if the Pokémon is holding a Mega Stone that it can Mega Evolve with.static booleanhasCompatibleMegaStone(HeldItem heldItem, Stats form) Checks if a Pokémon is holding a Mega Stone that it can Mega Evolve with.booleanChecks if the Pokémon is at full health.booleanhasFullHealth(boolean ignoreAbility) Checks if the Pokémon is at full health.booleanGets the Gigantamax Factor of the Pokémon.booleanChecks if the Pokémon has a held item.booleanhasMoved()Checks if the Pokémon has already moved during the turn.booleanReturns whether the Pokémon has a non-volatile status.booleanhasNonVolatileStatus(boolean includeComatose) Returns whether the Pokémon has a non-volatile status.booleanChecks if the Pokémon has a special item that cannot be removed in battle by the given user.booleanhasStatus(StatusType... statuses) Checks if the Pokémon has any of the specified statuses.booleanhasSubstituteBlockingAttacker(PixelmonWrapper attacker) Checks if the Pokémon has a Substitute that can block the attacking pokemonbooleanChecks if the Pokémon's type is one of a list of types.voidheal()Heals the Pokémon to full health, clears all status effects, and restores all PP.inthealByPercent(float percent) Heals the Pokémon by a certain percentage of its maximum health.inthealEntityBy(int i) Heals a Pokémon by a specified amount.booleanChecks if the Pokémon is airborne, preventing Ground-type attacks from hitting it.booleanisAlive()Returns whether the Pokémon can battle.booleanisAlly(PixelmonWrapper pokemon) booleanisAllyNotSelf(PixelmonWrapper pokemon) booleanbooleanReturns whether the Pokémon is fainted.booleanChecks if it is the first turn that the Pokémon has been out.booleanbooleanDetermines whether the Pokémon is grounded by an effect, negating being airborne.booleanChecks if the Pokémon is immune to powder moves.booleanisItemGivable(HeldItem item) Checks if this held item can be given to this pokemon during battle.booleanChecks if this Pokémon's held item can be removed during battle.booleanChecks if the pokemon is moving last of everyone this turn.booleanisOpponent(PixelmonWrapper pokemon) booleanGets whether this is a raid Pokémon.booleanisSameTeam(PixelmonWrapper other) Checks if a Pokémon is on the same team as this Pokémon.booleanChecks if the Pokémon is in a semi-invulnerable state.booleanChecks if the Pokémon is a single-typed Pokémon.booleanisSingleType(Element type) Checks if the Pokémon is a single-typed Pokémon of a certain type.booleanGets whether this is a wild Pokémon.booleanMega Evolves the Pokémon.voidbooleanreducePP(boolean reducePP, boolean affectPP) Reduce the Power Points (PP) of a move after it has been used.booleanRegister a Z-Move as used after it has been used.voidRemoves 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.voidremoveStatus(int i) Removes the status at the specified index.voidRemoves the status from the Pokémon.voidremoveStatus(StatusBase e, boolean showMessage) Removes the status from the Pokémon.booleanRemoves the specified status from the Pokémon.booleanremoveStatus(StatusType s, boolean message) Removes the specified status from the Pokémon.booleanremoveStatuses(boolean showMessage, StatusType... statuses) Removes the specified statuses from the Pokémon.booleanremoveStatuses(StatusType... statuses) Removes the specified statuses from the Pokémon.booleanremoveTeamStatus(StatusBase status) Removes a team status from Pokémon on this Pokémon's side of the field.booleanremoveTeamStatus(StatusType... statuses) Removes team statuses from Pokémon on this Pokémon's side of the field.booleanremoveType(Element type) Removes a given element from the base types.voidResets a Mega and Ash-Greninja Evolved Pokémon back to their base form.voidResets Pokémon attributes when switching.voidReturns the Pokémon to where it was at the start of the battle.voidSaves all the data on this attack to the info for the previous attack.voidDecides what action the AI will take during battle.voidsendStatusPacket(int statusID) Sends a status update to the client.voidsetAttack(int buttonId, List<PixelmonWrapper> targets, boolean megaEvolving) Sets the Pokémon's attack to the button pressed.voidsetAttack(Attack attack, List<PixelmonWrapper> targets, boolean willEvolve) Sets the Pokémon's attack to an attack.voidMarks the Pokémon's current attack as failed.voidsetBasePosition(double[] ds) Sets the Pokémon's initial position.voidsetConsumedItem(HeldItem heldItem) Sets the Pokémon's most recent consumed item.voidsetExp(int experience) Sets the Pokémon's experience.voidSets the form of a Pokémon.voidSets the form of a Pokémon.voidsetHealth(int newHP) Sets the Pokémon's current hp.voidsetHealthPercentage(float percentage) Sets the Pokemon's health to a certain percentage of its maximum health.voidsetHeldItem(HeldItem newItem) Sets the Pokémon's held item.voidsetHeldItem(net.minecraft.world.item.ItemStack itemStack) Sets the Pokémon's held item.voidsetLevelNum(int level) Sets the Pokémon's pokemonLevel.voidsetMoved(boolean moved) Sets if the Pokémon has already moved during the turn.voidsetMoveTargets(PixelmonWrapper... pokemon) Sets the targets of the Pokémon's attack.voidsetNewHeldItem(HeldItem heldItem) Sets a new held item for the Pokémon during battle.voidsetPalette(String paletteName) Sets the palette of a Pokémon.voidsetPrevForm(Stats form) Sets the previous form.voidsetPrevForm(String form) Sets the previous form.voidsetPrevPaletteName(String paletteName) Sets the palette of a Pokémon.voidsetRaidShields(int shields) voidsetStatus(int i, StatusBase newStatus) Changes a status into a different status.voidsetStruggle(List<PixelmonWrapper> targets) Sets the Pokémon's attack to Struggle.booleansetTempAbility(Ability newAbility) Sets a temporary Ability for the Pokémon if its Ability changes during battle.booleansetTempAbility(Ability newAbility, boolean formChange) Sets a temporary Ability for the Pokémon if its Ability changes during battle.voidsetTempLevel(int level) Sets a temporary pokemonLevel for the Pokémon to use in battle.voidsetTemporaryMoveset(Moveset moveset) booleansetTempType(Element newType) Sets a temporary type for the Pokémon if it changes during battle.booleansetTempType(List<Element> newType) Sets type for the Pokémon if it changes during battle.voidSets up variables for the Pokémon to switch out due to a move.booleanbooleanChecks if the turn is skipped for the PokémonbooleanChecks if the Pokémon prevents being forced outvoidsuppressType(Element type) booleanSwitches the Pokémon for start-of-turn switches.voidtakeTurn()Does the Pokémon's action for the turn.targetNewNonFaintedPokemon(List<PixelmonWrapper> correctedTargets, PixelmonWrapper target) .voidtargetNewPokemonSwitchedIn(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()voidturnTick()Handles end-of-turn effects.voidundoSuppressedType(Element type) voidupdate(EnumUpdateType... types) Updates the Pokémon client-side.voidupdateBattleDamage(int damage) Updates the client with changes to the Pokémon's health in battle.voidUpdates Pokémon in battle.voidupdateRaidShields(int shields) voidUses an attack and processes the results of the attack.voiduseAttack(boolean affectPP) Uses an attack and processes the results of the attack.Uses an attack without doing anything else.voiduseItem()Uses an item on the Pokémon.voiduseTempAttack(Attack tempAttack) Used if the attack used was called by another attack.voiduseTempAttack(Attack tempAttack, PixelmonWrapper target) Used if the attack used was called by another attack.voiduseTempAttack(Attack tempAttack, List<PixelmonWrapper> targets) Used if the attack used was called by another attack.voiduseTempAttack(Attack tempAttack, List<PixelmonWrapper> targets, boolean affectPP) Used if the attack used was called by another attack.voiduseTempAttack(Attack tempAttack, List<PixelmonWrapper> targets, boolean affectPP, boolean bypassesFlinch) Used if the attack used was called by another attack.voidvoidSaves 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()
-