Class PixelmonBlockStartingBattleEvent

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

public class PixelmonBlockStartingBattleEvent extends net.neoforged.bus.api.Event implements net.neoforged.bus.api.ICancellableEvent
Fired when a battle is started by a block, for example seaweed, tall grass, rock smashing, etc. Note that this event only fires when a battle would definitely be starting, which is not the same as PixelmonBlockTriggeredBattleEvent Canceling this event will stop the battle from starting.
  • Field Details

    • worldIn

      public final net.minecraft.world.level.Level worldIn
      The world in which the block activating the battle is located
    • pos

      public final net.minecraft.core.BlockPos pos
      The exact position of the block starting the battle
    • player

      public final net.minecraft.server.level.ServerPlayer player
      The player being engaged in the battle
    • startType

      public final BattleStartTypes startType
      The source of the battle as an element of EnumBattleStartTypes
    • initialisingPixelmon

      public final PixelmonEntity initialisingPixelmon
      The optional Pokemon that started it. For example, the Pokemon using headbutt.
    • wildPixelmon1

      public final PixelmonEntity wildPixelmon1
      The Pokemon being fought
    • wildPixelmon2

      public final PixelmonEntity wildPixelmon2
      The optional second Pokemon being fought, used in the event of a double battle
  • Constructor Details

    • PixelmonBlockStartingBattleEvent

      public PixelmonBlockStartingBattleEvent(net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerPlayer player, BattleStartTypes startType, PixelmonEntity fightingPokemon, PixelmonEntity pixelmon1, PixelmonEntity pixelmon2)