Interface ILootModifier

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @ZenRegister public interface 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.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ILootModifier
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default it.unimi.dsi.fastutil.objects.ObjectArrayList<net.minecraft.world.item.ItemStack>
    doApply(it.unimi.dsi.fastutil.objects.ObjectArrayList<net.minecraft.world.item.ItemStack> loot, net.minecraft.world.level.storage.loot.LootContext context)
    Applies the modifier to the drops of a loot table.
    modify(List<IItemStack> loot, net.minecraft.world.level.storage.loot.LootContext context)
    Applies the modifier to the drops of a loot table.
  • Field Details

  • Method Details

    • modify

      List<IItemStack> modify(List<IItemStack> loot, net.minecraft.world.level.storage.loot.LootContext context)
      Applies the modifier to the drops of a loot table.
      Parameters:
      loot - The loot dropped by a loot table.
      context - The context that caused the loot table to drop the loot.
      Returns:
      A list containing the modified loot.
      See Also:
      • LootContext
    • doApply

      default it.unimi.dsi.fastutil.objects.ObjectArrayList<net.minecraft.world.item.ItemStack> doApply(it.unimi.dsi.fastutil.objects.ObjectArrayList<net.minecraft.world.item.ItemStack> loot, net.minecraft.world.level.storage.loot.LootContext context)
      Applies the modifier to the drops of a loot table.
      Parameters:
      loot - The loot dropped by a loot table.
      context - The context that caused the loot table to drop the loot.
      Returns:
      A list containing the modified loot.
      See Also:
      • LootContext