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 Summary
FieldsModifier and TypeFieldDescriptionfinal PixelmonEntityThe optional Pokemon that started it.final net.minecraft.server.level.ServerPlayerThe player being engaged in the battlefinal net.minecraft.core.BlockPosThe exact position of the block starting the battlefinal BattleStartTypesThe source of the battle as an element of EnumBattleStartTypesfinal PixelmonEntityThe Pokemon being foughtfinal PixelmonEntityThe optional second Pokemon being fought, used in the event of a double battlefinal net.minecraft.world.level.LevelThe world in which the block activating the battle is located -
Constructor Summary
ConstructorsConstructorDescriptionPixelmonBlockStartingBattleEvent(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) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
worldIn
public final net.minecraft.world.level.Level worldInThe world in which the block activating the battle is located -
pos
public final net.minecraft.core.BlockPos posThe exact position of the block starting the battle -
player
public final net.minecraft.server.level.ServerPlayer playerThe player being engaged in the battle -
startType
The source of the battle as an element of EnumBattleStartTypes -
initialisingPixelmon
The optional Pokemon that started it. For example, the Pokemon using headbutt. -
wildPixelmon1
The Pokemon being fought -
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)
-