ILootModifier

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.

导入相关包

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.

import crafttweaker.api.loot.modifiers.ILootModifier;

方法

applyModifier

Applies the modifier to the drops of a loot table.

Return Type: stdlib.List<IItemStack>

ILootModifier.applyModifier(loot as stdlib.List<IItemStack>, currentContext as LootContext) as stdlib.List<IItemStack>
参数类型描述
lootstdlib.List<IItemStack>The loot dropped by a loot table.
currentContextLootContextThe context that caused the loot table to drop the loot.