Package net.minecraft.loot
Class LootContext.Builder
- java.lang.Object
-
- net.minecraft.loot.LootContext.Builder
-
- Enclosing class:
- LootContext
public static class LootContext.Builder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<ResourceLocation,LootContext.IDynamicDropProvider>
dynamicDrops
private ServerWorld
level
private float
luck
private java.util.Map<LootParameter<?>,java.lang.Object>
params
private ResourceLocation
queriedLootTableId
private java.util.Random
random
-
Constructor Summary
Constructors Constructor Description Builder(LootContext context)
Builder(ServerWorld p_i46993_1_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LootContext
create(LootParameterSet p_216022_1_)
ServerWorld
getLevel()
<T> T
getOptionalParameter(LootParameter<T> p_216019_1_)
<T> T
getParameter(LootParameter<T> p_216024_1_)
LootContext.Builder
withDynamicDrop(ResourceLocation p_216017_1_, LootContext.IDynamicDropProvider p_216017_2_)
LootContext.Builder
withLuck(float p_186469_1_)
<T> LootContext.Builder
withOptionalParameter(LootParameter<T> p_216021_1_, T p_216021_2_)
LootContext.Builder
withOptionalRandomSeed(long p_216016_1_)
LootContext.Builder
withOptionalRandomSeed(long p_216020_1_, java.util.Random p_216020_3_)
<T> LootContext.Builder
withParameter(LootParameter<T> p_216015_1_, T p_216015_2_)
LootContext.Builder
withRandom(java.util.Random p_216023_1_)
-
-
-
Field Detail
-
level
private final ServerWorld level
-
params
private final java.util.Map<LootParameter<?>,java.lang.Object> params
-
dynamicDrops
private final java.util.Map<ResourceLocation,LootContext.IDynamicDropProvider> dynamicDrops
-
random
private java.util.Random random
-
luck
private float luck
-
queriedLootTableId
private ResourceLocation queriedLootTableId
-
-
Constructor Detail
-
Builder
public Builder(ServerWorld p_i46993_1_)
-
Builder
public Builder(LootContext context)
-
-
Method Detail
-
withRandom
public LootContext.Builder withRandom(java.util.Random p_216023_1_)
-
withOptionalRandomSeed
public LootContext.Builder withOptionalRandomSeed(long p_216016_1_)
-
withOptionalRandomSeed
public LootContext.Builder withOptionalRandomSeed(long p_216020_1_, java.util.Random p_216020_3_)
-
withLuck
public LootContext.Builder withLuck(float p_186469_1_)
-
withParameter
public <T> LootContext.Builder withParameter(LootParameter<T> p_216015_1_, T p_216015_2_)
-
withOptionalParameter
public <T> LootContext.Builder withOptionalParameter(LootParameter<T> p_216021_1_, @Nullable T p_216021_2_)
-
withDynamicDrop
public LootContext.Builder withDynamicDrop(ResourceLocation p_216017_1_, LootContext.IDynamicDropProvider p_216017_2_)
-
getLevel
public ServerWorld getLevel()
-
getParameter
public <T> T getParameter(LootParameter<T> p_216024_1_)
-
getOptionalParameter
@Nullable public <T> T getOptionalParameter(LootParameter<T> p_216019_1_)
-
create
public LootContext create(LootParameterSet p_216022_1_)
-
-