Class DropExperienceBlock

All Implemented Interfaces:
FeatureElement, ItemLike, IBlockExtension
Direct Known Subclasses:
SculkBlock

public class DropExperienceBlock extends Block
  • Field Details

  • Constructor Details

  • Method Details

    • codec

      public com.mojang.serialization.MapCodec<? extends DropExperienceBlock> codec()
      Overrides:
      codec in class Block
    • spawnAfterBreak

      protected void spawnAfterBreak(BlockState p_221086_, ServerLevel p_221087_, BlockPos p_221088_, ItemStack p_221089_, boolean p_221090_)
      Overrides:
      spawnAfterBreak in class BlockBehaviour
    • getExpDrop

      public int getExpDrop(BlockState state, LevelReader level, RandomSource randomSource, BlockPos pos, int fortuneLevel, int silkTouchLevel)
      Description copied from interface: IBlockExtension
      Gathers how much experience this block drops when broken.
      Parameters:
      state - The current state
      level - The level
      randomSource - Random source to use for experience randomness
      pos - Block position
      fortuneLevel - fortune enchantment level of tool being used
      silkTouchLevel - silk touch enchantment level of tool being used
      Returns:
      Amount of XP from breaking this block.