Interface IGlobalLootModifier

All Known Implementing Classes:
LootModifier

public interface IGlobalLootModifier
Implementation that defines what a global loot modifier must implement in order to be functional. LootModifier Supplies base functionality; most modders should only need to extend that.
Requires a Codec to be registered: VRegistries.LOOT_MODIFIER_SERIALIZERS, and returned in codec() Individual instances of modifiers must be registered via json, see forge:loot_modifiers/global_loot_modifiers
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<IGlobalLootModifier>
     
    static final com.mojang.serialization.Codec<net.minecraft.world.level.storage.loot.predicates.LootItemCondition[]>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull it.unimi.dsi.fastutil.objects.ObjectArrayList<net.minecraft.world.item.ItemStack>
    apply(it.unimi.dsi.fastutil.objects.ObjectArrayList<net.minecraft.world.item.ItemStack> generatedLoot, net.minecraft.world.level.storage.loot.LootContext context)
     
    com.mojang.serialization.Codec<? extends IGlobalLootModifier>
    Returns the registered codec for this modifier
    static <U> com.google.gson.JsonElement
    getJson(com.mojang.serialization.Dynamic<?> dynamic)
     
  • Field Details

    • DIRECT_CODEC

      static final com.mojang.serialization.Codec<IGlobalLootModifier> DIRECT_CODEC
    • LOOT_CONDITIONS_CODEC

      static final com.mojang.serialization.Codec<net.minecraft.world.level.storage.loot.predicates.LootItemCondition[]> LOOT_CONDITIONS_CODEC
  • Method Details

    • getJson

      static <U> com.google.gson.JsonElement getJson(com.mojang.serialization.Dynamic<?> dynamic)
    • apply

      @NotNull @NotNull it.unimi.dsi.fastutil.objects.ObjectArrayList<net.minecraft.world.item.ItemStack> apply(it.unimi.dsi.fastutil.objects.ObjectArrayList<net.minecraft.world.item.ItemStack> generatedLoot, net.minecraft.world.level.storage.loot.LootContext context)
    • codec

      com.mojang.serialization.Codec<? extends IGlobalLootModifier> codec()
      Returns the registered codec for this modifier