Package net.minecraft.loot
Class LootFunction
- java.lang.Object
-
- net.minecraft.loot.LootFunction
-
- All Implemented Interfaces:
java.util.function.BiFunction<ItemStack,LootContext,ItemStack>
,ILootFunction
,IParameterized
- Direct Known Subclasses:
ApplyBonus
,CopyBlockState
,CopyName
,CopyNbt
,EnchantRandomly
,EnchantWithLevels
,ExplorationMap
,ExplosionDecay
,FillPlayerHead
,LimitCount
,LootingEnchantBonus
,SetAttributes
,SetContents
,SetCount
,SetDamage
,SetLootTable
,SetLore
,SetName
,SetNBT
,SetStewEffect
,Smelt
public abstract class LootFunction extends java.lang.Object implements ILootFunction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LootFunction.Builder<T extends LootFunction.Builder<T>>
static class
LootFunction.Serializer<T extends LootFunction>
(package private) static class
LootFunction.SimpleBuilder
-
Nested classes/interfaces inherited from interface net.minecraft.loot.functions.ILootFunction
ILootFunction.IBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Predicate<LootContext>
compositePredicates
protected ILootCondition[]
predicates
-
Constructor Summary
Constructors Modifier Constructor Description protected
LootFunction(ILootCondition[] p_i51231_1_)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ItemStack
apply(ItemStack p_apply_1_, LootContext p_apply_2_)
protected abstract ItemStack
run(ItemStack p_215859_1_, LootContext p_215859_2_)
protected static LootFunction.Builder<?>
simpleBuilder(java.util.function.Function<ILootCondition[],ILootFunction> p_215860_0_)
void
validate(ValidationTracker p_225580_1_)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraft.loot.functions.ILootFunction
getType
-
Methods inherited from interface net.minecraft.loot.IParameterized
getReferencedContextParams
-
-
-
-
Field Detail
-
predicates
protected final ILootCondition[] predicates
-
compositePredicates
private final java.util.function.Predicate<LootContext> compositePredicates
-
-
Constructor Detail
-
LootFunction
protected LootFunction(ILootCondition[] p_i51231_1_)
-
-
Method Detail
-
apply
public final ItemStack apply(ItemStack p_apply_1_, LootContext p_apply_2_)
- Specified by:
apply
in interfacejava.util.function.BiFunction<ItemStack,LootContext,ItemStack>
-
run
protected abstract ItemStack run(ItemStack p_215859_1_, LootContext p_215859_2_)
-
validate
public void validate(ValidationTracker p_225580_1_)
- Specified by:
validate
in interfaceIParameterized
-
simpleBuilder
protected static LootFunction.Builder<?> simpleBuilder(java.util.function.Function<ILootCondition[],ILootFunction> p_215860_0_)
-
-