Class PokemonLink
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.stats.links.PokemonLink
- Direct Known Subclasses:
DelegateLink
,WrapperLink
Links to a Pokémon object to get or update data.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
adjustFriendship
(int change) Changes the friendship of the Pokémon.abstract boolean
Checks if the Pokémon can gain experience and pokemonLevel up.abstract Ability
Gets the Pokémon's Ability.getBall()
Gets the base stats of the Pokémon.abstract BattleController
Gets the battle controller for the battle the Pokémon is in.abstract int
Gets the number of Egg cycles need to hatchEgg an Egg.abstract PixelmonEntity
Gets the Pokémon entity.abstract int
getExp()
Gets the Pokémon's experience.abstract int
Gets the amount of experience needed for the Pokémon to pokemonLevel up.abstract String
getForm()
Gets the Pokémon's form name.abstract int
Gets the Pokémon's friendship.abstract Gender
Gets the Pokémon's gender.net.minecraft.core.Holder<Growth>
abstract int
Gets the Pokémon's current hp.abstract HeldItem
Gets the Pokémon's held item.net.minecraft.world.item.ItemStack
abstract int
Gets the Pokémon's maximum hp.abstract int
getMaxHealth
(boolean ignoreDynamax) abstract Moveset
Gets the Pokémon's moves.abstract Nature
Gets the Pokémon's Nature.abstract net.minecraft.network.chat.Component
Gets the Pokémon's nickname.abstract net.minecraft.server.level.ServerPlayer
Gets the player who owns the Pokémon.abstract Pokemon
abstract int
Gets the Pokémon's pokemonLevel.abstract UUID
Gets the ID of the Pokémon.abstract net.minecraft.core.BlockPos
getPos()
Gets the world position of the Pokémon.abstract StatusPersist
Gets the non-volatile status on the Pokémon.net.minecraft.network.chat.Component
Gets the Pokémon's nickname, ignoring Illusion.Gets the species of the Pokémon.abstract PermanentStats
getStats()
Gets the numerical stats of the Pokémon.abstract PartyStorage
Gets the storage of the Pokémon's owner.getType()
Gets the Pokémon's type.abstract net.minecraft.world.level.Level
getWorld()
Gets the world that the Pokémon is in.abstract boolean
isEgg()
Checks if the Pokémon is an Egg.boolean
Checks if the Pokémon is fainted.boolean
isShiny()
abstract boolean
removeStatuses
(StatusType... statuses) Removes the specified statuses from the Pokémon.abstract void
sendMessage
(String langKey, Object... data) Sends a message to the client.abstract void
setExp
(int experience) Sets the Pokémon's experience.abstract void
setHealth
(int health) Sets the Pokémon's current hp.void
setHealthDirect
(int health) Directly sets the Pokémon's current hp, ignoring damage/heal processing.abstract void
setHeldItem
(net.minecraft.world.item.ItemStack item) Sets the Pokémon's held item.abstract void
setLevel
(int level) Sets the Pokémon's pokemonLevel.abstract void
setScale
(float scale) Sets the model scale of the Pokémon.toString()
abstract void
update
(EnumUpdateType... updateTypes) Updates the Pokémon client-side.abstract void
updateLevelUp
(PixelmonStatsData stats) Updates the Pokémon when it levels up.abstract void
Updates the Pokémon's stats client-side.
-
Constructor Details
-
PokemonLink
public PokemonLink()
-
-
Method Details
-
getPokemon
-
getBaseStats
Gets the base stats of the Pokémon.- Returns:
- The base stats of the Pokémon.
-
getStats
Gets the numerical stats of the Pokémon.- Returns:
- The numerical stats of the Pokémon.
-
getHeldItem
Gets the Pokémon's held item.- Returns:
- The Pokémon's held item.
-
setHeldItem
public abstract void setHeldItem(net.minecraft.world.item.ItemStack item) Sets the Pokémon's held item.- Parameters:
item
- The Pokémon's new held item.
-
getHealth
public abstract int getHealth()Gets the Pokémon's current hp.- Returns:
- The Pokémon's current hp.
-
getMaxHealth
public abstract int getMaxHealth()Gets the Pokémon's maximum hp.- Returns:
- The Pokémon's maximum hp.
-
getMaxHealth
public abstract int getMaxHealth(boolean ignoreDynamax) -
setHealth
public abstract void setHealth(int health) Sets the Pokémon's current hp.- Parameters:
health
- The Pokémon's current hp.
-
setHealthDirect
public void setHealthDirect(int health) Directly sets the Pokémon's current hp, ignoring damage/heal processing.- Parameters:
health
- The Pokémon's current hp.
-
getPokemonLevel
public abstract int getPokemonLevel()Gets the Pokémon's pokemonLevel.- Returns:
- The Pokémon's pokemonLevel.
-
setLevel
public abstract void setLevel(int level) Sets the Pokémon's pokemonLevel.- Parameters:
level
- The Pokémon's pokemonLevel.
-
getExp
public abstract int getExp()Gets the Pokémon's experience.- Returns:
- The Pokémon's experience.
-
setExp
public abstract void setExp(int experience) Sets the Pokémon's experience.- Parameters:
experience
- The Pokémon's experience.
-
getFriendship
public abstract int getFriendship()Gets the Pokémon's friendship.- Returns:
- The Pokémon's friendship.
-
doesLevel
public abstract boolean doesLevel()Checks if the Pokémon can gain experience and pokemonLevel up.- Returns:
- Whether the Pokémon can gain experience and pokemonLevel up.
-
getRealNickname
public net.minecraft.network.chat.Component getRealNickname()Gets the Pokémon's nickname, ignoring Illusion.- Returns:
- The Pokémon's nickname;
-
getPlayerOwner
public abstract 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.
-
getBattleController
Gets the battle controller for the battle the Pokémon is in.- Returns:
- The battle controller for the battle the Pokémon is in, or null if the Pokémon is not in a battle.
-
getMoveset
Gets the Pokémon's moves.- Returns:
- The Pokémon's moves.
-
getPokemonUUID
Gets the ID of the Pokémon.- Returns:
- The ID of the Pokémon.
-
getEntity
Gets the Pokémon entity. Sends it out if it isn't already out.- Returns:
- The Pokémon entity.
-
setScale
public abstract void setScale(float scale) Sets the model scale of the Pokémon.- Parameters:
scale
- The model scale of the Pokémon.
-
getWorld
public abstract net.minecraft.world.level.Level getWorld()Gets the world that the Pokémon is in.- Returns:
- The world that the Pokémon is in.
-
getGender
Gets the Pokémon's gender.- Returns:
- The Pokémon's gender.
-
getPos
public abstract net.minecraft.core.BlockPos getPos()Gets the world position of the Pokémon.- Returns:
- The world position of the Pokémon.
-
getStorage
Gets the storage of the Pokémon's owner.- Returns:
- The storage of the Pokémon's owner.
-
update
Updates the Pokémon client-side.- Parameters:
updateTypes
- The types of data to update.
-
updateStats
public abstract void updateStats()Updates the Pokémon's stats client-side. -
updateLevelUp
Updates the Pokémon when it levels up.- Parameters:
stats
- Data about the Pokémon stats after leveling up.
-
sendMessage
Sends a message to the client.- Parameters:
langKey
- The lang key for the message.data
- Additional arguments to pass into the lang string.
-
getNickname
public abstract net.minecraft.network.chat.Component getNickname()Gets the Pokémon's nickname.- Returns:
- The Pokémon's nickname.
-
removeStatuses
Removes the specified statuses from the Pokémon.- Parameters:
statuses
- The statuses to remove.- Returns:
- Whether a status was removed.
-
getNature
Gets the Pokémon's Nature.- Returns:
- The Pokémon's Nature.
-
getExpToNextLevel
public abstract int getExpToNextLevel()Gets the amount of experience needed for the Pokémon to pokemonLevel up.- Returns:
- The amount of experience needed for the Pokémon to pokemonLevel up.
-
getPrimaryStatus
Gets the non-volatile status on the Pokémon.- Returns:
- The non-volatile status on the Pokémon.
-
getAbility
Gets the Pokémon's Ability.- Returns:
- The Pokémon's Ability.
-
getType
Gets the Pokémon's type.- Returns:
- A list of the Pokémon's types.
-
getForm
Gets the Pokémon's form name.- Returns:
- The Pokémon's form name.
-
isFainted
public boolean isFainted()Checks if the Pokémon is fainted.- Returns:
- Whether the Pokémon is fainted.
-
isShiny
public boolean isShiny() -
isEgg
public abstract boolean isEgg()Checks if the Pokémon is an Egg.- Returns:
- Whether the Pokémon is an Egg.
-
getEggCycles
public abstract int getEggCycles()Gets the number of Egg cycles need to hatchEgg an Egg.- Returns:
- The number of Egg cycles need to hatchEgg an Egg.
-
getGrowth
-
getBall
-
getHeldItemStack
public net.minecraft.world.item.ItemStack getHeldItemStack() -
getPokerus
-
getSpecies
Gets the species of the Pokémon.- Returns:
- The species of the Pokémon.
-
toString
-
adjustFriendship
public abstract void adjustFriendship(int change) Changes the friendship of the Pokémon. Decreases in trust have a negative argument- Parameters:
change
- The change in friendship, negative if it is a decrease of friendship.
-