Class GlobalLootModifiersTest.WheatSeedsConverterModifier

java.lang.Object
net.neoforged.neoforge.common.loot.LootModifier
net.neoforged.neoforge.debug.loot.GlobalLootModifiersTest.WheatSeedsConverterModifier
All Implemented Interfaces:
IGlobalLootModifier
Enclosing class:
GlobalLootModifiersTest

private static class GlobalLootModifiersTest.WheatSeedsConverterModifier extends LootModifier
When harvesting wheat with shears, this modifier is invoked via the wheat_harvest loot_modifier json
This modifier checks how many seeds were harvested and turns X seeds into Y wheat (3:1)
  • Field Details

  • Constructor Details

    • WheatSeedsConverterModifier

      public WheatSeedsConverterModifier(LootItemCondition[] conditionsIn, int numSeeds, Item itemCheck, Item reward)
  • Method Details

    • doApply

      public it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> doApply(it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context)
      Description copied from class: LootModifier
      Applies the modifier to the generated loot (all loot conditions have already been checked and have returned true).
      Specified by:
      doApply in class LootModifier
      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
    • codec

      public com.mojang.serialization.MapCodec<? extends IGlobalLootModifier> codec()
      Description copied from interface: IGlobalLootModifier
      Returns the registered codec for this modifier