Class TumblestoneBlockEvent.PreBlockBroke
java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent
com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent.PreBlockBroke
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
TumblestoneBlockEvent
public static class TumblestoneBlockEvent.PreBlockBroke
extends TumblestoneBlockEvent
implements net.neoforged.bus.api.ICancellableEvent
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 -
Constructor Summary
ConstructorsConstructorDescriptionPreBlockBroke(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 TypeMethodDescriptionvoidAdds drops to the eventvoidRemoves all the dropsList<net.minecraft.world.item.ItemStack> getDrops()The drops from the blocknet.minecraft.world.item.ItemStackGets the item used in their MAIN_HANDnet.minecraft.world.entity.player.PlayerThe player breaking the blockMethods inherited from class com.pixelmonmod.pixelmon.api.events.blocks.TumblestoneBlockEvent
getPos, getState, getWorldMethods 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
-
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
-