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.

Importing the class

Link to importing-the-class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.loot.modifiers.ILootModifier;

Link to g-

Name: applyModifier

Applies the modifier to the drops of a loot table.

Returns: A new list containing the modified loot, or the old list if the loot shouldn't be modified.
Return Type: stdlib.List<IItemStack>

ZenScript
Copy
ILootModifier.applyModifier(loot as stdlib.List<IItemStack>, currentContext as LootContext) as stdlib.List<IItemStack>
ParameterTypeDescription
Parameter
loot
Type
stdlib.List<IItemStack>
Description
The loot dropped by a loot table.
Parameter
currentContext
Type
LootContext
Description
The context that caused the loot table to drop the loot.