BlockStateLootModifiers
Expands
This class expands
BlockState, meaning that the content found on this page can be called on that type directly.
Description
Additional methods for easier modification of block state-related loot tables.Members
addBlockLootModifier(name as string, modifier as ILootModifier)
Adds an script.zs            
ILootModifier to this block, ignoring the current state.myBlockState.addBlockLootModifier(myString, myILootModifier);Parameters:
name: string  Type: string 
- The name of the loot modifier.   addNoSilkTouchLootModifier(name as string, modifier as ILootModifier)
Adds an script.zs            
ILootModifier to this block, with the given name, only if it is not harvested with the silk touch enchantment.myBlockState.addNoSilkTouchLootModifier(myString, myILootModifier);Parameters:
name: string  Type: string 
- The name of the loot modifier to add.   addTargetedLootModifier(name as string, modifier as ILootModifier)
Adds an script.zs            
ILootModifier to the current block, only if it matches the current block state precisely.myBlockState.addTargetedLootModifier(myString, myILootModifier);Parameters:
name: string  Type: string 
- The name of the loot modifier.   addToolLootModifier(name as string, tool as IItemStack, modifier as ILootModifier)
Adds an 
script.zs            
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.
myBlockState.addToolLootModifier(myString, myIItemStack, myILootModifier);Parameters:
name: string  Type: string 
- The name of the loot modifier.   addToolLootModifier(name as string, tool as IItemStack, matchDamage as bool, modifier as ILootModifier)
Adds an 
script.zs             
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.
// BlockState.addToolLootModifier(name as string, tool as IItemStack, matchDamage as bool, modifier as ILootModifier);myBlockState.addToolLootModifier(myString, myIItemStack, myBool, myILootModifier);Parameters:
name: string  Type: string 
- The name of the loot modifier.   matchDamage: bool  Type: bool 
- Whether to consider damage or not when trying to match the tool.   addToolLootModifier(name as string, tool as IItemStack, matchDamage as bool, matchNbt as bool, modifier as ILootModifier)
Adds an 
script.zs              
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.
// BlockState.addToolLootModifier(name as string, tool as IItemStack, matchDamage as bool, matchNbt as bool, modifier as ILootModifier);myBlockState.addToolLootModifier(myString, myIItemStack, myBool, myBool, myILootModifier);Parameters:
name: string  Type: string 
- The name of the loot modifier.   matchDamage: bool  Type: bool 
- Whether to consider damage or not when trying to match the tool.   matchNbt: bool  Type: bool 
- Whether to consider NBT data or not when trying to match the tool.