Class ModifierSpecificExpandBlock

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

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

    • ModifierSpecificExpandBlock

      public ModifierSpecificExpandBlock()
  • Method Details

    • addLootModifier

      public static void addLootModifier(net.minecraft.world.level.block.Block internal, String name, ILootModifier modifier)
      Adds an ILootModifier to this block, with the given name.
      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.
    • addNoSilkTouchLootModifier

      public static void addNoSilkTouchLootModifier(net.minecraft.world.level.block.Block 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.
    • addStateLootModifier

      public static void addStateLootModifier(net.minecraft.world.level.block.Block internal, String name, net.minecraft.advancements.critereon.StatePropertiesPredicate.Builder statePredicate, ILootModifier modifier)
      Adds an ILootModifier to this block, firing only if it matches the state outlined in the StatePropertiesPredicate.
      Parameters:
      internal - The block to add the loot modifier to.
      name - The name of the loot modifier to add.
      statePredicate - A consumer to configure the StatePropertiesPredicate to identify the target state.
      modifier - The loot modifier to add.
    • addToolLootModifier

      public static void addToolLootModifier(net.minecraft.world.level.block.Block internal, String name, IItemStack tool, ILootModifier modifier)
      Adds an ILootModifier that fires if this block 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 to add the loot modifier to.
      name - The name of the loot modifier.
      tool - The tool the block was broken with.
      modifier - The loot modifier to add to the block.
    • addToolLootModifier

      public static void addToolLootModifier(net.minecraft.world.level.block.Block internal, String name, IItemStack tool, boolean matchComponents, ILootModifier modifier)
      Adds an ILootModifier that fires if this block 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 to add the loot modifier to.
      name - The name of the loot modifier.
      tool - The tool the block was broken with.
      matchComponents - Whether to consider components or not when trying to match the tool.
      modifier - The loot modifier to add to the block.