Class PixelmonBlockTriggeredBattleEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.PixelmonBlockTriggeredBattleEvent
public class PixelmonBlockTriggeredBattleEvent
extends net.minecraftforge.eventbus.api.Event
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-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionfinal BlockSpawningHandler
The specific spawning handler being used to trigger the eventfinal PixelmonEntity
The Pokemon that triggered the event if from aMoveSkill
otherwise it will be nullfinal net.minecraft.server.level.ServerPlayer
The player who triggered the eventfinal net.minecraft.core.BlockPos
The position of the block triggering the eventfinal BattleStartTypes
The source of the battle as an element of EnumBattleStartTypesfinal net.minecraft.world.level.Level
The world in which the triggering block is located -
Constructor Summary
ConstructorDescriptionPixelmonBlockTriggeredBattleEvent
(BlockSpawningHandler handler, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.server.level.ServerPlayer player, PixelmonEntity entityPixelmon, BattleStartTypes startType) -
Method Summary
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
handler
The specific spawning handler being used to trigger the event -
world
public final net.minecraft.world.level.Level worldThe world in which the triggering block is located -
pos
public final net.minecraft.core.BlockPos posThe position of the block triggering the event -
player
public final net.minecraft.server.level.ServerPlayer playerThe player who triggered the event -
pixelmon
The Pokemon that triggered the event if from aMoveSkill
otherwise it will be null -
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)
-