Class MysteryBoxEvent.Open.Pre
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent
com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent.Open
com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent.Open.Pre
- Enclosing class:
- MysteryBoxEvent.Open
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent.Open
MysteryBoxEvent.Open.Post, MysteryBoxEvent.Open.Pre
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent
MysteryBoxEvent.Activate, MysteryBoxEvent.ComparatorPower, MysteryBoxEvent.Feed, MysteryBoxEvent.Open, MysteryBoxEvent.Tick
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Constructor Summary
ConstructorDescriptionPre
(MysteryBoxTileEntity box, net.minecraft.world.entity.player.Player player, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.item.ItemStack itemStack, boolean canOpen) Fired when a Mystery Box is about to be opened. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canOpen()
Whether the Mystery Box will open from this interaction or not.void
setCanOpen
(boolean canOpen) Changes whether the Mystery Box will open from this interaction or not.Methods inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent.Open
getItemStack, getPlayer
Methods inherited from class com.pixelmonmod.pixelmon.api.events.blocks.MysteryBoxEvent
getBlockState, getBox
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Constructor Details
-
Pre
public Pre(MysteryBoxTileEntity box, net.minecraft.world.entity.player.Player player, net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.item.ItemStack itemStack, boolean canOpen) Fired when a Mystery Box is about to be opened. Cancelable.- Parameters:
box
- The Mystery Box tile entity.player
- The player instigating this event.blockState
- The block state of this Mystery Box.itemStack
- The item stack being used in this interaction.canOpen
- Whether the Mystery Box will open or not.
-
-
Method Details
-
canOpen
public boolean canOpen()Whether the Mystery Box will open from this interaction or not.- Returns:
- Whether the Mystery Box will open.
-
setCanOpen
public void setCanOpen(boolean canOpen) Changes whether the Mystery Box will open from this interaction or not.- Parameters:
canOpen
- Whether the Mystery Box will open.
-