ILootModifier

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.loot.modifier.ILootModifier;

Description

Represents a modifier that gets applied to the loot dropped by a loot table.

A modifier is something that can act on and change the loot dropped by a loot table, represented as a list of IItemStack, leveraging the original LootContext that caused the loot drop.

Members

modify(loot as List<IItemStack>, context as LootContext) as List<IItemStack>
Applies the modifier to the drops of a loot table.

Returns: A list containing the modified loot.

script.zs
// ILootModifier.modify(loot as List<IItemStack>, context as LootContext) as List<IItemStack>;
myILootModifier.modify(myList, myLootContext);

Parameters:

loot Type: List<IItemStack> - The loot dropped by a loot table.
context Type: LootContext - The context that caused the loot table to drop the loot.

Return Type: List<IItemStack>