Class PokemonBuilder
java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.PokemonBuilder
Builder class for creating a new Pokemon instance
-
Method Summary
Modifier and TypeMethodDescriptionability
(@Nullable RegistryValue<Ability> ability) Sets the ability of the Pokémon Leaving null will allow the Pokémon initialize algorithm to calculate the relevant one for the form/gender (etc)Sets the ability of the Pokémon Leaving null will allow the Pokémon initialize algorithm to calculate the relevant one for the form/gender (etc)abilitySlot
(int slot, boolean usesHiddenAbility) Sets the ability slots of the Pokémon, overriding .ability() Leaving null will allow the Pokémon initialize algorithm to calculate the relevant one for the form/gender (etc)bonusStats
(BonusStats stats) Adds additional stats on top of normal battle stats.build()
Creates the Pokémon instance using the provided informationstatic PokemonBuilder
builder()
Creates a new instance of a PokemonBuilder objectcaughtBall
(@NonNull RegistryValue<PokeBall> caughtBall) Sets the ball of the PokémoncaughtBall
(@NonNull PokeBall caughtBall) Sets the ball of the Pokémonstatic PokemonBuilder
displayedRibbon
(Ribbon ribbon) Specifies the selected ribbon on the PokemondynamaxLevel
(int dynamaxLevel) Sets the Pokémon to have the specified dynamax levelegg
(boolean egg) Makes the Pokémon an eggSets the progress towards hatchingev
(@NonNull BattleStatsType type, int ev) Sets the value of an EVevs
(@org.checkerframework.checker.nullness.qual.NonNull int... evs) Sets the EVs of the Pokémonexperience
(int experience) Sets the experience of the PokémonextraStats
(@NonNull ExtraStats extraStats) Sets the extra stats of the PokémonAdds flags to the Pokémonflags
(Collection<String> flags) Adds flags to the PokémonSets the form of the Pokémon Setting to null selects a random default form from the speciesSets the form of the Pokémon Setting to null selects a random default form from the speciesfriendship
(int friendship) Sets the friendship of the PokémonSets the gender of the Pokémonint
int[]
getEvs()
int
getFlags()
getForm()
int
net.minecraft.world.item.ItemStack
boolean[]
int[]
getIvs()
int
getLevel()
Attack[]
getMoves()
net.minecraft.network.chat.Component
net.minecraft.nbt.CompoundTag
double
getSize()
getUuid()
Sets the Pokémon to have the Gigantamax FactorgigantamaxFactor
(boolean gigantamaxFactor) Sets the Pokémon to have the Gigantamax Factor if true, or not if falsehappiness
(int friendship) Sets the friendship of the PokémonhealthPercent
(float percent) Sets the current health of the PokemonSets the held item of the PokémonheldItem
(@NonNull net.minecraft.world.item.ItemStack heldItem) Sets the held item of the PokémonhyperTrained
(boolean[] hypertrainedArray) Sets the hyper-trained status for the IVs of the Pokemonboolean
isEgg()
boolean
iv
(@NonNull BattleStatsType type, int iv) Sets the value of an IVivs
(@org.checkerframework.checker.nullness.qual.NonNull int... ivs) Sets the IVs of the Pokémonlevel
(int level) Sets the level of the PokémonmakeEgg()
Makes the Pokémon an eggmintNature
(@Nullable Nature mintNature) Sets the mint nature of the PokémonSets the move to theAttack
at the given indexmove
(int index, @Nullable ImmutableAttack attack) Sets the move to theImmutableAttack
at the given indexfinal PokemonBuilder
moveReminderMoves
(@NonNull RegistryValue<ImmutableAttack>... reminderMoves) Sets the moves this Pokémon gets from the Move Reminderfinal PokemonBuilder
moveReminderMoves
(@NonNull Set<ImmutableAttack> reminderMoves) Sets the moves this Pokémon gets from the Move Reminderfinal PokemonBuilder
moves
(@NonNull RegistryValue<ImmutableAttack>... givenMoves) Sets the moves of the PokémonSets the moves of the PokémonSets the nature of the PokémonSets the nickname of the Pokémon Leaving null means no nicknamenickname
(@Nullable net.minecraft.network.chat.Component nickname) Sets the nickname of the Pokémon Leaving null means no nicknameoriginalTrainer
(@Nullable UUID originalTrainer, @Nullable String originalTrainerName) Sets the original trainer UUID of the PokémonoriginalTrainer
(@Nullable net.minecraft.world.entity.player.Player player) Sets the original trainer UUID of the PokémonSets the palette of the Pokémon Setting to null selects a random default palette from the formpersistentData
(net.minecraft.nbt.CompoundTag data) Adds the persistent nbt data for the pokemonSets the Pokérus status of the PokémonSets the species to a randomly selected species usingPixelmonSpecies.getRandomSpecies()
randomSpecies
(boolean excludeLegendaries, boolean excludeMythicals, boolean excludeUltraBeasts) Sets the species to a randomly selected species usingPixelmonSpecies.getRandomSpecies(boolean, boolean, boolean)
}randomSpecies
(RegistryValue<Species>... excluded) Sets the species to a random species excluding those givenrandomSpecies
(Collection<RegistryValue<Species>> excluded) Sets the species to a random species excluding those givenrandomSpecies
(Predicate<Species> excluded) Sets the species to a random species excluding those set to be excluded in the predicateribbons
(Collection<Ribbon> ribbons) Adds ribbons to the Pokemonshiny()
Sets the Pokémon palette to be shinyshiny
(boolean shiny) Sets the Pokémon palette to be shiny if true, null if falsesize
(double size) Sets the size of the Pokémonspecies
(int ndex) Sets the speciesspecies
(@NonNull RegistryValue<Species> species) Sets the speciesSets the speciesSets the speciesSets the speciesspecs
(PokemonSpecification... specs) Adds post-creation specs to applyAdds post-creation specs to applyspecs
(Collection<String> specs) Adds post-creation specs to applystatus
(@NonNull StatusPersist status) Sets the status of the PokémontempAbility
(String ability) Sets the temp ability of the Pokémon, stored in MovesetSets the UUID Setting to null selects a random UUID
-
Method Details
-
copy
-
builder
Creates a new instance of a PokemonBuilder object- Returns:
- The builder object
-
uuid
Sets the UUID Setting to null selects a random UUID- Parameters:
uuid
- The new UUID- Returns:
- The builder instance
-
randomSpecies
Sets the species to a randomly selected species usingPixelmonSpecies.getRandomSpecies()
- Returns:
- The builder instance
-
randomSpecies
public PokemonBuilder randomSpecies(boolean excludeLegendaries, boolean excludeMythicals, boolean excludeUltraBeasts) Sets the species to a randomly selected species usingPixelmonSpecies.getRandomSpecies(boolean, boolean, boolean)
}- Parameters:
excludeLegendaries
- - Whether or not Legendaries are includedexcludeMythicals
- - Whether or not Mythicals are includedexcludeUltraBeasts
- - Whether or not Ultra Beasts are included- Returns:
- The builder instance
-
randomSpecies
Sets the species to a random species excluding those given- Parameters:
excluded
- the Pokémon to exclude- Returns:
- The builder instance
-
randomSpecies
Sets the species to a random species excluding those given- Parameters:
excluded
- the Pokémon to exclude- Returns:
- The builder instance
-
randomSpecies
Sets the species to a random species excluding those set to be excluded in the predicate- Parameters:
excluded
- the Pokémon to exclude (returning true means it will be excluded - false means it will be accepted)- Returns:
- The builder instance
-
species
Sets the species- Parameters:
speciesName
- The name of the species to apply- Returns:
- The builder instance
-
species
Sets the species- Parameters:
species
- The species registry value to apply- Returns:
- The builder instance
-
species
Sets the species- Parameters:
species
- The optional species to apply- Returns:
- The builder instance
-
species
Sets the species- Parameters:
ndex
- The species national dex ID- Returns:
- The builder instance
-
species
Sets the species- Parameters:
species
- The species to apply- Returns:
- The builder instance
-
makeEgg
Makes the Pokémon an egg- Returns:
- The builder instance
-
egg
Makes the Pokémon an egg- Returns:
- The builder instance
-
eggSteps
Sets the progress towards hatching- Returns:
- The builder instance
-
gender
Sets the gender of the Pokémon- Parameters:
gender
- The gender to apply- Returns:
- The builder instance
-
shiny
Sets the Pokémon palette to be shiny- Returns:
- The builder instance
-
shiny
Sets the Pokémon palette to be shiny if true, null if false- Returns:
- The builder instance
-
palette
Sets the palette of the Pokémon Setting to null selects a random default palette from the form- Parameters:
palette
- The palette to apply- Returns:
- The builder instance
-
form
Sets the form of the Pokémon Setting to null selects a random default form from the species- Parameters:
form
- The form to apply- Returns:
- The builder instance
-
form
Sets the form of the Pokémon Setting to null selects a random default form from the species- Parameters:
form
- The form to apply- Returns:
- The builder instance
-
ability
Sets the ability of the Pokémon Leaving null will allow the Pokémon initialize algorithm to calculate the relevant one for the form/gender (etc)- Parameters:
ability
- The ability to apply- Returns:
- The builder instance
-
ability
Sets the ability of the Pokémon Leaving null will allow the Pokémon initialize algorithm to calculate the relevant one for the form/gender (etc)- Parameters:
ability
- The ability to apply- Returns:
- The builder instance
-
abilitySlot
Sets the ability slots of the Pokémon, overriding .ability() Leaving null will allow the Pokémon initialize algorithm to calculate the relevant one for the form/gender (etc)- Parameters:
slot
- The index of the abilityusesHiddenAbility
- Whether the ability should be the hidden ability- Returns:
- The builder instance
-
tempAbility
Sets the temp ability of the Pokémon, stored in Moveset- Parameters:
ability
- The name of the ability- Returns:
- The builder instance
-
nickname
Sets the nickname of the Pokémon Leaving null means no nickname- Parameters:
nickname
- The nickname to apply- Returns:
- The builder instance
-
nickname
Sets the nickname of the Pokémon Leaving null means no nickname- Parameters:
nickname
- The nickname to apply- Returns:
- The builder instance
-
heldItem
Sets the held item of the Pokémon- Parameters:
heldItem
- The held item to apply- Returns:
- The builder instance
-
heldItem
Sets the held item of the Pokémon- Parameters:
heldItem
- The held ItemStack to apply- Returns:
- The builder instance
-
happiness
Sets the friendship of the Pokémon- Parameters:
friendship
- The new friendship to apply- Returns:
- The builder instance
-
friendship
Sets the friendship of the Pokémon- Parameters:
friendship
- The new friendship to apply- Returns:
- The builder instance
-
experience
Sets the experience of the Pokémon- Parameters:
experience
- The new experience to apply- Returns:
- The builder instance
-
ev
Sets the value of an EV- Parameters:
type
- The type of EVev
- The EV value to apply- Returns:
- The builder instance
-
iv
Sets the value of an IV- Parameters:
type
- The type of IViv
- The IV value to apply- Returns:
- The builder instance
-
evs
Sets the EVs of the Pokémon- Parameters:
evs
- The EVs to apply- Returns:
- The builder instance
-
ivs
Sets the IVs of the Pokémon- Parameters:
ivs
- The IVs to apply- Returns:
- The builder instance
-
hyperTrained
Sets the hyper-trained status for the IVs of the Pokemon- Parameters:
hypertrainedArray
- Whether each IV is hyper-trained- Returns:
- The builder instance
-
move
Sets the move to theImmutableAttack
at the given index- Parameters:
index
- The index of the move in the party (0-3)attack
- The attack to apply- Returns:
- The builder instance
-
move
Sets the move to theAttack
at the given index- Parameters:
index
- The index of the move in the party (0-3)attack
- The attack to apply- Returns:
- The builder instance
-
moves
Sets the moves of the Pokémon- Parameters:
moves
- The moves to apply- Returns:
- The builder instance
-
moves
@SafeVarargs public final PokemonBuilder moves(@NonNull RegistryValue<ImmutableAttack>... givenMoves) Sets the moves of the Pokémon- Parameters:
givenMoves
- The moves to apply- Returns:
- The builder instance
-
moveReminderMoves
@SafeVarargs public final PokemonBuilder moveReminderMoves(@NonNull RegistryValue<ImmutableAttack>... reminderMoves) Sets the moves this Pokémon gets from the Move Reminder- Parameters:
reminderMoves
- The moves to apply- Returns:
- The builder instance
-
moveReminderMoves
Sets the moves this Pokémon gets from the Move Reminder- Parameters:
reminderMoves
- The moves to apply- Returns:
- The builder instance
-
nature
Sets the nature of the Pokémon- Parameters:
nature
- The nature to apply- Returns:
- The builder instance
-
size
Sets the size of the Pokémon- Parameters:
size
- The size to apply- Returns:
- The builder instance
-
mintNature
Sets the mint nature of the Pokémon- Parameters:
mintNature
- The mint nature to apply- Returns:
- The builder instance
-
level
Sets the level of the Pokémon- Parameters:
level
- The level to apply- Returns:
- The builder instance
-
caughtBall
Sets the ball of the Pokémon- Parameters:
caughtBall
- The ball to apply- Returns:
- The builder instance
-
caughtBall
Sets the ball of the Pokémon- Parameters:
caughtBall
- The ball to apply- Returns:
- The builder instance
-
extraStats
Sets the extra stats of the Pokémon- Parameters:
extraStats
- The extra stats for the species to apply- Returns:
- The builder instance
-
originalTrainer
public PokemonBuilder originalTrainer(@Nullable UUID originalTrainer, @Nullable String originalTrainerName) Sets the original trainer UUID of the Pokémon- Parameters:
originalTrainer
- The original trainer's UUIDoriginalTrainerName
- The original trainer's name- Returns:
- The builder instance
-
originalTrainer
Sets the original trainer UUID of the Pokémon- Parameters:
player
- The original trainer to apply- Returns:
- The builder instance
-
specs
Adds post-creation specs to apply- Parameters:
specs
- The specs to apply- Returns:
- The builder instance
-
specs
Adds post-creation specs to apply- Parameters:
specs
- The specs to apply- Returns:
- The builder instance
-
specs
Adds post-creation specs to apply- Parameters:
specs
- The specs to apply- Returns:
- The builder instance
-
pokerus
Sets the Pokérus status of the Pokémon- Parameters:
pokerus
- The Pokérus value to apply- Returns:
- The builder instance
-
status
Sets the status of the Pokémon- Parameters:
status
- The status to apply- Returns:
- The builder instance
-
healthPercent
Sets the current health of the Pokemon- Parameters:
percent
- The percent of max hp- Returns:
- The builder instance
-
gigantamaxFactor
Sets the Pokémon to have the Gigantamax Factor- Returns:
- The builder instance
-
gigantamaxFactor
Sets the Pokémon to have the Gigantamax Factor if true, or not if false- Returns:
- The builder instance
-
dynamaxLevel
Sets the Pokémon to have the specified dynamax level- Returns:
- The builder instance
-
flags
Adds flags to the Pokémon- Parameters:
flags
- The flags- Returns:
- The builder instance
-
flags
Adds flags to the Pokémon- Parameters:
flags
- The flags- Returns:
- The builder instance
-
ribbons
Adds ribbons to the Pokemon- Parameters:
ribbons
- The ribbons- Returns:
- The builder instance
-
displayedRibbon
Specifies the selected ribbon on the Pokemon- Parameters:
ribbon
- The ribbon- Returns:
- The builder instance
-
bonusStats
Adds additional stats on top of normal battle stats.- Parameters:
stats
- The stats to be added- Returns:
- The builder instance
-
persistentData
Adds the persistent nbt data for the pokemon- Parameters:
data
- The nbt data- Returns:
- The builder instance
-
getUuid
-
getSpecies
-
getPalette
-
getForm
-
isEgg
public boolean isEgg() -
getEggSteps
-
getGender
-
getAbility
-
getNickname
public net.minecraft.network.chat.Component getNickname() -
getHeldItem
public net.minecraft.world.item.ItemStack getHeldItem() -
getFriendship
public int getFriendship() -
getIvs
public int[] getIvs() -
getHyperTrained
public boolean[] getHyperTrained() -
getEvs
public int[] getEvs() -
getMoves
-
getReminderMoves
-
getTempAbility
-
getBaseNature
-
getMintNature
-
getLevel
public int getLevel() -
getExperience
public int getExperience() -
getSize
public double getSize() -
getCaughtBall
-
getExtraStats
-
getOriginalTrainer
-
getOriginalTrainerName
-
getPokerus
-
getStatus
-
isGigantamaxFactor
public boolean isGigantamaxFactor() -
getDynamaxLevel
public int getDynamaxLevel() -
getDisplayedRibbon
-
getRibbons
-
getFlags
-
getPokemonSpecs
-
getBonusStats
-
getPersistentData
public net.minecraft.nbt.CompoundTag getPersistentData() -
build
Creates the Pokémon instance using the provided information- Returns:
- The new Pokémon
-