Class TumblestoneBlockEvent.PreBlockBroke
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent
com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent.PreBlockBroke
- Enclosing class:
- TumblestoneBlockEvent
Fires before the block drops the items after broken
Cancelling prevents the drops
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent
TumblestoneBlockEvent.PostBlockBroke, TumblestoneBlockEvent.PostBlockDestroy, TumblestoneBlockEvent.PostCooldownEnd, TumblestoneBlockEvent.PostGrow, TumblestoneBlockEvent.PreBlockBroke, TumblestoneBlockEvent.PreBlockDestroy, TumblestoneBlockEvent.PreCooldownEnd, TumblestoneBlockEvent.PreGrow
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
ConstructorDescriptionPreBlockBroke
(net.minecraft.world.level.Level level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack itemStack, List<net.minecraft.world.item.ItemStack> drops) The basic constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds drops to the eventvoid
Removes all the dropsList<net.minecraft.world.item.ItemStack>
getDrops()
The drops from the blocknet.minecraft.world.item.ItemStack
Gets the item used in their MAIN_HANDnet.minecraft.world.entity.player.Player
The player breaking the blockMethods inherited from class com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent
getPos, getState, getWorld
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Constructor Details
-
PreBlockBroke
public PreBlockBroke(net.minecraft.world.level.Level level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack itemStack, List<net.minecraft.world.item.ItemStack> drops) The basic constructor- Parameters:
state
- The block statepos
- The position of the blockplayer
- The playeritemStack
- The item in MAIN_HANDdrops
- The player drops
-
-
Method Details
-
getPlayer
public net.minecraft.world.entity.player.Player getPlayer()The player breaking the block- Returns:
- The player
-
getItemStack
public net.minecraft.world.item.ItemStack getItemStack()Gets the item used in their MAIN_HAND- Returns:
- The item in the hand
-
getDrops
The drops from the block- Returns:
- The block drops
-
addDrops
Adds drops to the event- Parameters:
items
- The drops being added
-
clearDrops
public void clearDrops()Removes all the drops
-