Class ModifierSpecificExpandBlockState

java.lang.Object
com.blamejared.crafttweaker.natives.loot.modifier.ModifierSpecificExpandBlockState

@ZenRegister public final class ModifierSpecificExpandBlockState extends Object
Additional methods for easier modification of block state-related loot tables.
  • Constructor Details

    • ModifierSpecificExpandBlockState

      public ModifierSpecificExpandBlockState()
  • Method Details

    • addBlockLootModifier

      public static void addBlockLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, ILootModifier modifier)
      Adds an ILootModifier to this block, ignoring the current state.
      Parameters:
      internal - The block state to add the drops to.
      name - The name of the loot modifier.
      modifier - The loot modifier to add.
    • addTargetedLootModifier

      public static void addTargetedLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, ILootModifier modifier)
      Adds an ILootModifier to the current block, only if it matches the current block state precisely.
      Parameters:
      internal - The block state to add the drops to.
      name - The name of the loot modifier.
      modifier - The loot modifier to add to the block state.
    • addNoSilkTouchLootModifier

      public static void addNoSilkTouchLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, ILootModifier modifier)
      Adds an ILootModifier to this block, with the given name, only if it is not harvested with the silk touch enchantment.
      Parameters:
      internal - The block to add the loot modifier to.
      name - The name of the loot modifier to add.
      modifier - The loot modifier to add.
    • addToolLootModifier

      public static void addToolLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, IItemStack tool, ILootModifier modifier)
      Adds an ILootModifier that fires if this block state gets broken with the given tool.

      Parameters that may be attached to the tool such as count, damage, or NBT data are ignored.

      Parameters:
      internal - The block state to add the loot modifier to.
      name - The name of the loot modifier.
      tool - The tool the block state was broken with.
      modifier - The loot modifier to add to the block state.
    • addToolLootModifier

      public static void addToolLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, IItemStack tool, boolean matchDamage, ILootModifier modifier)
      Adds an ILootModifier that fires if this block state gets broken with the given tool, optionally considering its damage.

      Additional parameters that may be attached to the tool, such as NBT or count, are ignored.

      Parameters:
      internal - The block state to add the loot modifier to.
      name - The name of the loot modifier.
      tool - The tool the block state was broken with.
      matchDamage - Whether to consider damage or not when trying to match the tool.
      modifier - The loot modifier to add to the block state.
    • addToolLootModifier

      public static void addToolLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, IItemStack tool, boolean matchDamage, boolean matchNbt, ILootModifier modifier)
      Adds an ILootModifier that fires if this block state gets broken with the given tool, optionally considering its damage or NBT.

      Additional parameters that may be attached to the tool, such as count, are ignored.

      Parameters:
      internal - The block state to add the loot modifier to.
      name - The name of the loot modifier.
      tool - The tool the block state was broken with.
      matchDamage - Whether to consider damage or not when trying to match the tool.
      matchNbt - Whether to consider NBT data or not when trying to match the tool.
      modifier - The loot modifier to add to the block state.