Class ModifierSpecificExpandBlockState
java.lang.Object
com.blamejared.crafttweaker.natives.loot.modifier.ModifierSpecificExpandBlockState
Additional methods for easier modification of block state-related loot tables.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBlockLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, ILootModifier modifier) Adds anILootModifierto this block, ignoring the current state.static voidaddNoSilkTouchLootModifier(net.minecraft.world.level.block.state.BlockState 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 voidaddTargetedLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, ILootModifier modifier) Adds anILootModifierto the current block, only if it matches the current block state precisely.static voidaddToolLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, IItemStack tool, boolean matchComponents, ILootModifier modifier) Adds anILootModifierthat fires if this block state gets broken with the given tool, optionally considering its damage or NBT.static voidaddToolLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, IItemStack tool, ILootModifier modifier) Adds anILootModifierthat fires if this block state gets broken with the given tool.
-
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 anILootModifierto 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 anILootModifierto 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 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.
-
addToolLootModifier
public static void addToolLootModifier(net.minecraft.world.level.block.state.BlockState internal, String name, IItemStack tool, ILootModifier modifier) Adds anILootModifierthat 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 matchComponents, ILootModifier modifier) Adds anILootModifierthat 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.matchComponents- Whether to consider components or not when trying to match the tool.modifier- The loot modifier to add to the block state.
-