类 AddTableLootModifier

java.lang.Object
net.neoforged.neoforge.common.loot.LootModifier
net.neoforged.neoforge.common.loot.AddTableLootModifier
所有已实现的接口:
IGlobalLootModifier

public class AddTableLootModifier extends LootModifier

Loot modifier that rolls one loot table (the "subtable" and adds the results to the loot being modified (the "target table"). Loot modifiers are not rolled for the subtable, as that could result in the subtables' items being modified twice (by downstream loot modifiers modifying the target table).

Json format:

 {
   "type": "neoforge:add_table",
   "conditions": [], // conditions block to predicate target tables by
   "table": "namespace:loot_table_id" // subtable to roll loot for to add to the target table(s)
 }
 

  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • table

      public ResourceKey<LootTable> table()
    • doApply

      protected it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> doApply(it.unimi.dsi.fastutil.objects.ObjectArrayList<ItemStack> generatedLoot, LootContext context)
      从类复制的说明: LootModifier
      Applies the modifier to the generated loot (all loot conditions have already been checked and have returned true).
      指定者:
      doApply 在类中 LootModifier
      参数:
      generatedLoot - the list of ItemStacks that will be dropped, generated by loot tables
      context - the LootContext, identical to what is passed to loot tables
      返回:
      modified loot drops
    • codec

      public com.mojang.serialization.MapCodec<? extends IGlobalLootModifier> codec()
      从接口复制的说明: IGlobalLootModifier
      Returns the registered codec for this modifier