Class ExpandLootContextBuilder
java.lang.Object
com.blamejared.crafttweaker.natives.loot.ExpandLootContextBuilder
Creates a new
LootContext using a builder style pattern.- DocParam:
- this new LootContextBuilder(level)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.level.storage.loot.LootContext.Buildercopy(net.minecraft.world.level.storage.loot.LootContext context) static net.minecraft.world.level.storage.loot.LootContextcreate(net.minecraft.world.level.storage.loot.LootContext.Builder internal, net.minecraft.resources.ResourceLocation key) Creates a newLootContextwith the givenLootContextParamSet.static net.minecraft.world.level.storage.loot.LootContext.Buildercreate(net.minecraft.world.level.storage.loot.LootParams params) Creates a new builder with the given level.static net.minecraft.server.level.ServerLevelgetLevel(net.minecraft.world.level.storage.loot.LootContext.Builder internal) Gets the level that this builder uses.static net.minecraft.world.level.storage.loot.LootContext.BuilderwithOptionalRandomSeed(net.minecraft.world.level.storage.loot.LootContext.Builder internal, long seed) Supplies a seed to be passed into a newRandom.
-
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 newRandom.- Parameters:
seed- The optional seed to use, defaults to0.- 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 newLootContextwith the givenLootContextParamSet.The given
LootContextParamSetis 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()
-