Class ExpandLootContextBuilder

java.lang.Object
com.blamejared.crafttweaker.natives.loot.ExpandLootContextBuilder

@ZenRegister public final class ExpandLootContextBuilder extends Object
Creates a new LootContext using a builder style pattern.
DocParam:
this new LootContextBuilder(level)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.level.storage.loot.LootContext.Builder
    copy(net.minecraft.world.level.storage.loot.LootContext context)
     
    static net.minecraft.world.level.storage.loot.LootContext
    create(net.minecraft.world.level.storage.loot.LootContext.Builder internal, net.minecraft.resources.ResourceLocation key)
    Creates a new LootContext with the given LootContextParamSet.
    static net.minecraft.world.level.storage.loot.LootContext.Builder
    create(net.minecraft.world.level.storage.loot.LootParams params)
    Creates a new builder with the given level.
    static net.minecraft.server.level.ServerLevel
    getLevel(net.minecraft.world.level.storage.loot.LootContext.Builder internal)
    Gets the level that this builder uses.
    static net.minecraft.world.level.storage.loot.LootContext.Builder
    withOptionalRandomSeed(net.minecraft.world.level.storage.loot.LootContext.Builder internal, long seed)
    Supplies a seed to be passed into a new Random.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExpandLootContextBuilder

      public ExpandLootContextBuilder()
  • Method Details

    • create

      public static net.minecraft.world.level.storage.loot.LootContext.Builder create(net.minecraft.world.level.storage.loot.LootParams params)
      Creates a new builder with the given level.
      Parameters:
      params - The params the loot will be rolled with.
      Returns:
      A new builder.
    • copy

      public static net.minecraft.world.level.storage.loot.LootContext.Builder copy(net.minecraft.world.level.storage.loot.LootContext context)
    • withOptionalRandomSeed

      public static net.minecraft.world.level.storage.loot.LootContext.Builder withOptionalRandomSeed(net.minecraft.world.level.storage.loot.LootContext.Builder internal, long seed)
      Supplies a seed to be passed into a new Random.
      Parameters:
      seed - The optional seed to use, defaults to 0.
      Returns:
      This builder for chaining purposes.
      DocParam:
      seed 1
    • getLevel

      public static net.minecraft.server.level.ServerLevel getLevel(net.minecraft.world.level.storage.loot.LootContext.Builder internal)
      Gets the level that this builder uses.
      Returns:
      The level that this builder uses.
    • create

      public static net.minecraft.world.level.storage.loot.LootContext create(net.minecraft.world.level.storage.loot.LootContext.Builder internal, net.minecraft.resources.ResourceLocation key)
      Creates a new LootContext with the given LootContextParamSet.

      The given LootContextParamSet is used to determine what values are required for the context to be used.

      Parameters:
      key - An optional random key used when no seed is provided.
      Returns:
      a new LootContext
      DocParam:
      contextParamSet LootContextParamSets.gift()