Package net.minecraftforge.common.loot
Class LootModifier
java.lang.Object
net.minecraftforge.common.loot.LootModifier
- All Implemented Interfaces:
- IGlobalLootModifier
- Direct Known Subclasses:
- GlobalLootModifiersTest.DungeonLootEnhancerModifier,- GlobalLootModifiersTest.SilkTouchTestModifier,- GlobalLootModifiersTest.SmeltingEnchantmentModifier,- GlobalLootModifiersTest.WheatSeedsConverterModifier
A base implementation of a Global Loot Modifier for modders to extend.
 Takes care of ILootCondition matching and comes with a base serializer
 implementation that takes care of Forge registry things.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedLootModifier(LootItemCondition[] conditionsIn)Constructs a LootModifier.
- 
Method SummaryModifier and TypeMethodDescriptionapply(List<ItemStack> generatedLoot, LootContext context)Applies the modifier to the list of generated loot.doApply(List<ItemStack> generatedLoot, LootContext context)Applies the modifier to the generated loot (all loot conditions have already been checked and have returned true).
- 
Field Details- 
conditions
- 
combinedConditions
 
- 
- 
Constructor Details- 
LootModifierConstructs a LootModifier.- Parameters:
- conditionsIn- the ILootConditions that need to be matched before the loot is modified.
 
 
- 
- 
Method Details- 
applyDescription copied from interface:IGlobalLootModifierApplies the modifier to the list of generated loot. This function needs to be responsible for checking ILootConditions as well.- Specified by:
- applyin interface- IGlobalLootModifier
- Parameters:
- generatedLoot- the list of ItemStacks that will be dropped, generated by loot tables
- context- the LootContext, identical to what is passed to loot tables
- Returns:
- modified loot drops
 
- 
doApply@Nonnull protected abstract List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context)Applies the modifier to the generated loot (all loot conditions have already been checked and have returned true).- Parameters:
- generatedLoot- the list of ItemStacks that will be dropped, generated by loot tables
- context- the LootContext, identical to what is passed to loot tables
- Returns:
- modified loot drops
 
 
-