Class ThrowPokeballEvent

java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.ThrowPokeballEvent
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent

public class ThrowPokeballEvent extends net.neoforged.bus.api.Event implements net.neoforged.bus.api.ICancellableEvent
Fired when a Pokéball is used in battle, or thrown outside of battle. Cancelable, but only when usedInBattle is false
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    net.minecraft.world.item.ItemStack
    The ItemStack for the Pokéball
    net.minecraft.world.entity.player.Player
    The player throwing the Pokéball
    The type of Pokéball being thrown
    boolean
    Whether or not the ball was thrown from in battle
  • Constructor Summary

    Constructors
    Constructor
    Description
    ThrowPokeballEvent(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack itemStack, PokeBall type, boolean usedInBattle)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setCanceled(boolean cancel)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.neoforged.bus.api.ICancellableEvent

    isCanceled
  • Field Details

    • player

      public net.minecraft.world.entity.player.Player player
      The player throwing the Pokéball
    • itemStack

      public net.minecraft.world.item.ItemStack itemStack
      The ItemStack for the Pokéball
    • type

      public PokeBall type
      The type of Pokéball being thrown
    • usedInBattle

      public boolean usedInBattle
      Whether or not the ball was thrown from in battle
  • Constructor Details

    • ThrowPokeballEvent

      public ThrowPokeballEvent(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack itemStack, PokeBall type, boolean usedInBattle)
  • Method Details

    • setCanceled

      public void setCanceled(boolean cancel)
      Specified by:
      setCanceled in interface net.neoforged.bus.api.ICancellableEvent