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 classLootContext.Builderstatic interfaceLootContext.Dropperstatic classLootContext.EntityTarget -
Field Summary
Fields Modifier and Type Field Description private Set<LootTable>activeTablesprivate Function<Identifier,LootCondition>conditionGetterprivate Set<LootCondition>conditionsprivate Map<Identifier,LootContext.Dropper>dropsprivate floatluckprivate Map<LootContextParameter<?>,Object>parametersprivate Randomrandomprivate Function<Identifier,LootTable>tableGetterprivate ServerWorldworld -
Constructor Summary
Constructors Modifier Constructor Description privateLootContext(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 booleanaddCondition(LootCondition condition)voiddrop(Identifier id, Consumer<ItemStack> lootConsumer)<T> Tget(LootContextParameter<T> parameter)LootConditiongetCondition(Identifier id)floatgetLuck()RandomgetRandom()LootTablegetSupplier(Identifier id)ServerWorldgetWorld()booleanhasParameter(LootContextParameter<?> parameter)booleanmarkActive(LootTable table)voidmarkInactive(LootTable table)voidremoveCondition(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
-