Class PixelmonInteraction
java.lang.Object
com.pixelmonmod.pixelmon.entities.pixelmon.interactions.custom.PixelmonInteraction
- Direct Known Subclasses:
CameruptInteraction
,MiltankInteraction
,ShearInteraction
A special interaction with a specific pokemon of Pokémon.
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
The amount of ticks before incrementing the Pokémon's stored interactions.int
The maximum number of interactions that the Pokémon can store. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PixelmonInteraction
getInteraction
(Species species) Gets the interaction for a Pokémon.boolean
processInteract
(AbstractBaseEntity pixelmon, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.item.ItemStack itemstack) Handles a player interacting with the Pokémon.void
resetCounter
(AbstractBaseEntity pixelmon) Ticks the timer for incrementing the Pokémon's interactions.
-
Field Details
-
maxInteractions
public int maxInteractionsThe maximum number of interactions that the Pokémon can store. -
counter
public int counterThe amount of ticks before incrementing the Pokémon's stored interactions.
-
-
Constructor Details
-
PixelmonInteraction
public PixelmonInteraction(int maxInteractions) Initializes an interaction.- Parameters:
maxInteractions
- The maximum number of intetractions that the Pokémon can store.
-
-
Method Details
-
processInteract
public boolean processInteract(AbstractBaseEntity pixelmon, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.item.ItemStack itemstack) Handles a player interacting with the Pokémon.- Parameters:
player
- The player interacting with the Pokémon.- Returns:
- Whether the interaction caused something to occur.
-
resetCounter
Ticks the timer for incrementing the Pokémon's interactions. -
getInteraction
Gets the interaction for a Pokémon.- Parameters:
species
- The Pokémon to get an interaction for.- Returns:
- The interaction for the Pokémon, or null if the Pokémon doesn't have one.
-