Class PlayerActivateShrineEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.PlayerActivateShrineEvent
- Direct Known Subclasses:
PlayerActivateShrineEvent.Post
,PlayerActivateShrineEvent.Pre
public class PlayerActivateShrineEvent
extends net.minecraftforge.eventbus.api.Event
Fires whenever a legendary bird shrine is activated
Canceling this event will prevent the shrine from activating
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
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
-
Constructor Summary
ConstructorDescriptionPlayerActivateShrineEvent
(net.minecraft.core.BlockPos blockPos, net.minecraft.server.level.ServerPlayer player, ShrineBlock block, ShrineType shrineType, BirdShrineTileEntity shrine, boolean canEncounter, PixelmonEntity pixelmonEntity) Basic constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
The result of theEncounterData.canEncounter(Player)
methodgetBlock()
Gets the block interacted withnet.minecraft.core.BlockPos
Gets the block position of the interacted blocknet.minecraft.world.level.block.state.BlockState
Gets the block state at the given positionGets the PixelmonEntity to be spawnednet.minecraft.server.level.ServerPlayer
Gets the player interacting with the shrineGets the tile entity being interacted withGets the type of shrine being interacted withMethods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
canEncounter
protected boolean canEncounter -
pixelmonEntity
-
-
Constructor Details
-
PlayerActivateShrineEvent
public PlayerActivateShrineEvent(net.minecraft.core.BlockPos blockPos, net.minecraft.server.level.ServerPlayer player, ShrineBlock block, ShrineType shrineType, BirdShrineTileEntity shrine, boolean canEncounter, PixelmonEntity pixelmonEntity) Basic constructor- Parameters:
blockPos
- The position of the blockplayer
- The player interacting with the blockblock
- The block type being interacted withshrineType
- The type of shrineshrine
- The shrine tile entitycanEncounter
- If the player can encounter the shrinepixelmonEntity
- The Pokémon to be spawned
-
-
Method Details
-
getBlockPos
public net.minecraft.core.BlockPos getBlockPos()Gets the block position of the interacted block- Returns:
- The block position
-
getBlockState
public net.minecraft.world.level.block.state.BlockState getBlockState()Gets the block state at the given position- Returns:
- The state
-
getBlock
Gets the block interacted with- Returns:
- The block interacted with
-
getPlayer
public net.minecraft.server.level.ServerPlayer getPlayer()Gets the player interacting with the shrine- Returns:
- The player
-
getShrineType
Gets the type of shrine being interacted with- Returns:
- The shrine type
-
getShrine
Gets the tile entity being interacted with- Returns:
- The shrine tile entity
-
canEncounter
public boolean canEncounter()The result of theEncounterData.canEncounter(Player)
method- Returns:
- If the player can encounter this shrine
-
getPixelmonEntity
Gets the PixelmonEntity to be spawned- Returns:
- The shrine tile entity
-