Class PixelmonBlockTriggeredBattleEvent

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

public class PixelmonBlockTriggeredBattleEvent extends net.neoforged.bus.api.Event implements net.neoforged.bus.api.ICancellableEvent
Fires when a battle MIGHT be started as a result of a block such as seaweed, tall grass, rock smash, etc. Note that this event will fire even if a battle will not occur. In the event of rock smash, there is still a chance that no battle will be started. This event is only in regards to the actual potential of a battle starting. If you want the event for the battle starting, see PixelmonBlockStartingBattleEvent Canceling this event will stop any chance of a battle starting
  • Field Details

    • handler

      public final BlockSpawningHandler handler
      The specific spawning handler being used to trigger the event
    • world

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

      public final net.minecraft.core.BlockPos pos
      The position of the block triggering the event
    • player

      public final net.minecraft.server.level.ServerPlayer player
      The player who triggered the event
    • pixelmon

      public final PixelmonEntity pixelmon
      The Pokemon that triggered the event if from a MoveSkill otherwise it will be null
    • startType

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

    • PixelmonBlockTriggeredBattleEvent

      public PixelmonBlockTriggeredBattleEvent(BlockSpawningHandler handler, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerPlayer player, PixelmonEntity entityPixelmon, BattleStartTypes startType)