Class FabricBlockLootTableProvider
java.lang.Object
net.minecraft.data.server.BlockLootTableGenerator
net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider
- All Implemented Interfaces:
Consumer<BiConsumer<net.minecraft.util.Identifier,
,net.minecraft.loot.LootTable.Builder>> FabricLootTableProvider
,net.minecraft.data.DataProvider
- Direct Known Subclasses:
FabricBlockLootTablesProvider
public abstract class FabricBlockLootTableProvider
extends net.minecraft.data.server.BlockLootTableGenerator
implements FabricLootTableProvider
Extend this class and implement
generateBlockLootTables()
.
Register an instance of the class with FabricDataGenerator.addProvider(java.util.function.Function<net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator, P>)
in a DataGeneratorEntrypoint
-
Field Summary
Fields inherited from interface net.minecraft.data.DataProvider
SHA1
Fields inherited from interface net.fabricmc.fabric.api.datagen.v1.provider.FabricLootTableProvider
GSON
-
Constructor Summary
ModifierConstructorDescriptionprotected
FabricBlockLootTableProvider
(FabricDataGenerator dataGenerator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(BiConsumer<net.minecraft.util.Identifier, net.minecraft.loot.LootTable.Builder> biConsumer) void
excludeFromStrictValidation
(net.minecraft.block.Block block) Disable strict validation for the passed block.protected abstract void
Implement this method to add block drops.net.minecraft.loot.context.LootContextType
getName()
Methods inherited from class net.minecraft.data.server.BlockLootTableGenerator
addDoorDrop, addDrop, addDrop, addDropWithSilkTouch, addDropWithSilkTouch, addPottedPlantDrop, dropsNothing
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.fabricmc.fabric.api.datagen.v1.provider.FabricLootTableProvider
run, withConditions
-
Field Details
-
dataGenerator
-
-
Constructor Details
-
FabricBlockLootTableProvider
-
-
Method Details
-
generateBlockLootTables
protected abstract void generateBlockLootTables()Implement this method to add block drops.Use the range of
BlockLootTableGenerator.addDrop(net.minecraft.block.Block, net.minecraft.item.ItemConvertible)
methods to generate block drops. -
excludeFromStrictValidation
public void excludeFromStrictValidation(net.minecraft.block.Block block) Disable strict validation for the passed block. -
getLootContextType
public net.minecraft.loot.context.LootContextType getLootContextType()- Specified by:
getLootContextType
in interfaceFabricLootTableProvider
-
getFabricDataGenerator
- Specified by:
getFabricDataGenerator
in interfaceFabricLootTableProvider
-
accept
public void accept(BiConsumer<net.minecraft.util.Identifier, net.minecraft.loot.LootTable.Builder> biConsumer) - Specified by:
accept
in interfaceConsumer<BiConsumer<net.minecraft.util.Identifier,
net.minecraft.loot.LootTable.Builder>> - Overrides:
accept
in classnet.minecraft.data.server.BlockLootTableGenerator
-
getName
- Specified by:
getName
in interfacenet.minecraft.data.DataProvider
-