Expansion for IItemStack

Additional methods for easier modification of item stack-related loot tables.

方法

addToolModifier

Adds an ILootModifier for everything that uses this item as a tool, such as block breaking.

Additional parameters that further identify the tool, such as NBT data, damage, or count, are ignored.

Return Type: void

ZenScript
Copy
IItemStack.addToolModifier(name as string, modifier as ILootModifier) as void
参数类型描述
namestringA name for the loot modifier.
modifierILootModifierThe loot modifier to add.
addToolModifier

Adds an ILootModifier for everything that uses this item as a tool, such as block breaking, optionally considering its damage.

Additional parameters that further identify the tool, such as NBT data, or count, are ignored.

Return Type: void

ZenScript
Copy
IItemStack.addToolModifier(name as string, matchDamage as boolean, modifier as ILootModifier) as void
参数类型描述
namestringA name for the loot modifier.
matchDamagebooleanWhether to consider damage or not when trying to match the tool.
modifierILootModifierThe loot modifier to add.
addToolModifier

Adds an ILootModifier for everything that uses this item as a tool, such as block breaking, optionally considering its damage and count.

Additional parameters that further identify the tool, such as NBT data, are ignored.

Return Type: void

ZenScript
Copy
IItemStack.addToolModifier(name as string, matchDamage as boolean, matchCount as boolean, modifier as ILootModifier) as void
参数类型描述
namestringA name for the loot modifier.
matchDamagebooleanWhether to consider damage or not when trying to match the tool.
matchCountbooleanWhether to consider the amount or not when trying to match the tool.
modifierILootModifierThe loot modifier to add.
addToolModifier

Adds an ILootModifier for everything that uses this item as a tool, such as block breaking, optionally considering its damage, count, and NBT data.

Return Type: void

ZenScript
Copy
IItemStack.addToolModifier(name as string, matchDamage as boolean, matchCount as boolean, matchNbt as boolean, modifier as ILootModifier) as void
参数类型描述
namestringA name for the loot modifier.
matchDamagebooleanWhether to consider damage or not when trying to match the tool.
matchCountbooleanWhether to consider the amount or not when trying to match the tool.
matchNbtbooleanWhether to consider NBT data or not when trying to match the tool.
modifierILootModifierThe loot modifier to add.