Class ModifierSpecificExpandBlock
java.lang.Object
com.blamejared.crafttweaker.natives.loot.modifier.ModifierSpecificExpandBlock
Additional methods for easier modification of block-related loot tables.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddLootModifier(net.minecraft.world.level.block.Block internal, String name, ILootModifier modifier) Adds anILootModifierto this block, with the given name.static voidaddNoSilkTouchLootModifier(net.minecraft.world.level.block.Block internal, String name, ILootModifier modifier) Adds anILootModifierto this block, with the given name, only if it is not harvested with the silk touch enchantment.static voidaddStateLootModifier(net.minecraft.world.level.block.Block internal, String name, net.minecraft.advancements.critereon.StatePropertiesPredicate.Builder statePredicate, ILootModifier modifier) Adds anILootModifierto this block, firing only if it matches the state outlined in theStatePropertiesPredicate.static voidaddToolLootModifier(net.minecraft.world.level.block.Block internal, String name, IItemStack tool, boolean matchComponents, ILootModifier modifier) Adds anILootModifierthat fires if this block gets broken with the given tool, optionally considering its damage or NBT.static voidaddToolLootModifier(net.minecraft.world.level.block.Block internal, String name, IItemStack tool, ILootModifier modifier) Adds anILootModifierthat fires if this block gets broken with the given tool.
-
Constructor Details
-
ModifierSpecificExpandBlock
public ModifierSpecificExpandBlock()
-
-
Method Details
-
addLootModifier
public static void addLootModifier(net.minecraft.world.level.block.Block internal, String name, ILootModifier modifier) Adds anILootModifierto 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 anILootModifierto 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 anILootModifierto this block, firing only if it matches the state outlined in theStatePropertiesPredicate.- Parameters:
internal- The block to add the loot modifier to.name- The name of the loot modifier to add.statePredicate- A consumer to configure theStatePropertiesPredicateto 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 anILootModifierthat 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 anILootModifierthat 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.
-