Package org.cyclops.cyclopscore.helper
Class LootHelpers
java.lang.Object
org.cyclops.cyclopscore.helper.LootHelpers
Helpers related to loot stuff.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
injectLootTable
(net.minecraft.resources.ResourceLocation source, net.minecraft.resources.ResourceLocation... targets) Inject the given loot table from a loot table file into the given targets.static void
injectLootTableDirect
(net.minecraft.world.level.storage.loot.LootTable target, net.minecraft.resources.ResourceLocation source) void
onLootTableLoad
(net.minecraftforge.event.LootTableLoadEvent event) static net.minecraft.world.level.storage.loot.predicates.LootItemConditionType
registerCondition
(net.minecraft.resources.ResourceLocation id, net.minecraft.world.level.storage.loot.Serializer<? extends net.minecraft.world.level.storage.loot.predicates.LootItemCondition> serializer) Register a new loot condition.static net.minecraft.world.level.storage.loot.functions.LootItemFunctionType
registerFunction
(net.minecraft.resources.ResourceLocation id, net.minecraft.world.level.storage.loot.Serializer<? extends net.minecraft.world.level.storage.loot.functions.LootItemFunction> serializer) Register a new loot function.
-
Method Details
-
onLootTableLoad
public void onLootTableLoad(net.minecraftforge.event.LootTableLoadEvent event) -
injectLootTable
public static void injectLootTable(net.minecraft.resources.ResourceLocation source, net.minecraft.resources.ResourceLocation... targets) Inject the given loot table from a loot table file into the given targets.- Parameters:
source
- The source loot table file to inject to the targets.targets
- The targets to inject to.
-
injectLootTableDirect
public static void injectLootTableDirect(net.minecraft.world.level.storage.loot.LootTable target, net.minecraft.resources.ResourceLocation source) -
registerFunction
public static net.minecraft.world.level.storage.loot.functions.LootItemFunctionType registerFunction(net.minecraft.resources.ResourceLocation id, net.minecraft.world.level.storage.loot.Serializer<? extends net.minecraft.world.level.storage.loot.functions.LootItemFunction> serializer) Register a new loot function.- Parameters:
id
- The loot function id.serializer
- The loot function serializer.- Returns:
- The created loot function type
-
registerCondition
public static net.minecraft.world.level.storage.loot.predicates.LootItemConditionType registerCondition(net.minecraft.resources.ResourceLocation id, net.minecraft.world.level.storage.loot.Serializer<? extends net.minecraft.world.level.storage.loot.predicates.LootItemCondition> serializer) Register a new loot condition.- Parameters:
id
- The loot condition id.serializer
- The loot condition serializer.- Returns:
- The created loot condition type
-