public static class MysteryBoxEvent.Open.Pre extends MysteryBoxEvent.Open
MysteryBoxEvent.Open.Post, MysteryBoxEvent.Open.PreMysteryBoxEvent.Activate, MysteryBoxEvent.ComparatorPower, MysteryBoxEvent.Feed, MysteryBoxEvent.Open, MysteryBoxEvent.Tick| Constructor and Description |
|---|
Pre(MysteryBoxTileEntity box,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.block.BlockState blockState,
net.minecraft.item.ItemStack itemStack,
boolean canOpen)
Fired when a Mystery Box is about to be opened.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
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.
|
getItemStack, getPlayergetBlockState, getBoxpublic Pre(MysteryBoxTileEntity box, net.minecraft.entity.player.PlayerEntity player, net.minecraft.block.BlockState blockState, net.minecraft.item.ItemStack itemStack, boolean canOpen)
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.public boolean canOpen()
public void setCanOpen(boolean canOpen)
canOpen - Whether the Mystery Box will open.