BlockLootModifiers
Expands
This class expands
Block
, meaning that the content found on this page can be called on that type directly.
Description
Additional methods for easier modification of block-related loot tables.Members
addLootModifier(name as string, modifier as ILootModifier)
Adds an
ILootModifier
to this block, with the given name. Parameters:
name: string
Type: string
- The name of the loot modifier to add. addNoSilkTouchLootModifier(name as string, modifier as ILootModifier)
Adds an
ILootModifier
to this block, with the given name, only if it is not harvested with the silk touch enchantment. Parameters:
name: string
Type: string
- The name of the loot modifier to add. addStateLootModifier(name as string, statePredicate as Builder, modifier as ILootModifier)
Adds an
ILootModifier
to this block, firing only if it matches the state outlined in the StatePropertiesPredicate
. Parameters:
name: string
Type: string
- The name of the loot modifier to add. statePredicate: StatePropertiesPredicateBuilder
Type: StatePropertiesPredicateBuilder
- A consumer to configure the StatePropertiesPredicate
to identify the target state. addToolLootModifier(name as string, tool as IItemStack, modifier as ILootModifier)
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:
name: string
Type: string
- The name of the loot modifier. addToolLootModifier(name as string, tool as IItemStack, matchComponents as bool, modifier as ILootModifier)
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:
name: string
Type: string
- The name of the loot modifier. matchComponents: bool
Type: bool
- Whether to consider components or not when trying to match the tool.