Package net.minecraft.loot.functions
Class EnchantRandomly
- java.lang.Object
-
- net.minecraft.loot.LootFunction
-
- net.minecraft.loot.functions.EnchantRandomly
-
- All Implemented Interfaces:
java.util.function.BiFunction<ItemStack,LootContext,ItemStack>
,ILootFunction
,IParameterized
public class EnchantRandomly extends LootFunction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EnchantRandomly.Builder
static class
EnchantRandomly.Serializer
-
Nested classes/interfaces inherited from interface net.minecraft.loot.functions.ILootFunction
ILootFunction.IBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Enchantment>
enchantments
private static org.apache.logging.log4j.Logger
LOGGER
-
Fields inherited from class net.minecraft.loot.LootFunction
predicates
-
-
Constructor Summary
Constructors Modifier Constructor Description private
EnchantRandomly(ILootCondition[] p_i51238_1_, java.util.Collection<Enchantment> p_i51238_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static ItemStack
enchantItem(ItemStack p_237420_0_, Enchantment p_237420_1_, java.util.Random p_237420_2_)
LootFunctionType
getType()
static LootFunction.Builder<?>
randomApplicableEnchantment()
ItemStack
run(ItemStack p_215859_1_, LootContext p_215859_2_)
-
Methods inherited from class net.minecraft.loot.LootFunction
apply, simpleBuilder, validate
-
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.IParameterized
getReferencedContextParams
-
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
enchantments
private final java.util.List<Enchantment> enchantments
-
-
Constructor Detail
-
EnchantRandomly
private EnchantRandomly(ILootCondition[] p_i51238_1_, java.util.Collection<Enchantment> p_i51238_2_)
-
-
Method Detail
-
getType
public LootFunctionType getType()
-
run
public ItemStack run(ItemStack p_215859_1_, LootContext p_215859_2_)
- Specified by:
run
in classLootFunction
-
enchantItem
private static ItemStack enchantItem(ItemStack p_237420_0_, Enchantment p_237420_1_, java.util.Random p_237420_2_)
-
randomApplicableEnchantment
public static LootFunction.Builder<?> randomApplicableEnchantment()
-
-