Package net.minecraft.loot.context
Class LootContext
java.lang.Object
net.minecraft.loot.context.LootContext
public class LootContext extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LootContext.Builder
static interface
LootContext.Dropper
static class
LootContext.EntityTarget
-
Field Summary
Fields Modifier and Type Field Description private Set<LootTable>
activeTables
private Function<Identifier,LootCondition>
conditionGetter
private Set<LootCondition>
conditions
private Map<Identifier,LootContext.Dropper>
drops
private float
luck
private Map<LootContextParameter<?>,Object>
parameters
private Random
random
private Function<Identifier,LootTable>
tableGetter
private ServerWorld
world
-
Constructor Summary
Constructors Modifier Constructor Description private
LootContext(Random random, float luck, ServerWorld world, Function<Identifier,LootTable> tableGetter, Function<Identifier,LootCondition> conditionSetter, Map<LootContextParameter<?>,Object> parameters, Map<Identifier,LootContext.Dropper> drops)
-
Method Summary
Modifier and Type Method Description boolean
addCondition(LootCondition condition)
void
drop(Identifier id, Consumer<ItemStack> lootConsumer)
<T> T
get(LootContextParameter<T> parameter)
LootCondition
getCondition(Identifier id)
float
getLuck()
Random
getRandom()
LootTable
getSupplier(Identifier id)
ServerWorld
getWorld()
boolean
hasParameter(LootContextParameter<?> parameter)
boolean
markActive(LootTable table)
void
markInactive(LootTable table)
void
removeCondition(LootCondition condition)
-
Field Details
-
random
-
luck
private final float luck -
world
-
tableGetter
-
activeTables
-
conditionGetter
-
conditions
-
parameters
-
drops
-
-
Constructor Details
-
LootContext
private LootContext(Random random, float luck, ServerWorld world, Function<Identifier,LootTable> tableGetter, Function<Identifier,LootCondition> conditionSetter, Map<LootContextParameter<?>,Object> parameters, Map<Identifier,LootContext.Dropper> drops)
-
-
Method Details
-
hasParameter
-
drop
-
get
-
markActive
-
markInactive
-
addCondition
-
removeCondition
-
getSupplier
-
getCondition
-
getRandom
-
getLuck
public float getLuck() -
getWorld
-