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

public static class TumblestoneBlockEvent.PreBlockBroke extends TumblestoneBlockEvent
Fires before the block drops the items after broken Cancelling prevents the drops
  • 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 state
      pos - The position of the block
      player - The player
      itemStack - The item in MAIN_HAND
      drops - 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

      public List<net.minecraft.world.item.ItemStack> getDrops()
      The drops from the block
      Returns:
      The block drops
    • addDrops

      public void addDrops(List<net.minecraft.world.item.ItemStack> items)
      Adds drops to the event
      Parameters:
      items - The drops being added
    • clearDrops

      public void clearDrops()
      Removes all the drops