Class FabricBlockLootTableProvider
java.lang.Object
net.minecraft.data.server.BlockLootTableGenerator
net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider
- All Implemented Interfaces:
Consumer<BiConsumer<Identifier,
,LootTable.Builder>> FabricLootTableProvider
,DataProvider
public abstract class FabricBlockLootTableProvider
extends 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
FieldsFields inherited from interface net.minecraft.data.DataProvider
JSON_KEY_SORT_ORDER, JSON_KEY_SORTING_COMPARATOR
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FabricBlockLootTableProvider
(FabricDataGenerator dataGenerator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(BiConsumer<Identifier, LootTable.Builder> biConsumer) void
excludeFromStrictValidation
(Block block) Disable strict validation for the passed block.protected abstract void
Implement this method to add block drops.getName()
Methods inherited from class net.minecraft.data.server.BlockLootTableGenerator
addDrop, addDrop, addDropWithSilkTouch, addDropWithSilkTouch, addPottedPlantDrop, doorDrops, 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
Disable strict validation for the passed block. -
getLootContextType
- Specified by:
getLootContextType
in interfaceFabricLootTableProvider
-
getFabricDataGenerator
- Specified by:
getFabricDataGenerator
in interfaceFabricLootTableProvider
-
accept
- Specified by:
accept
in interfaceConsumer<BiConsumer<Identifier,
LootTable.Builder>> - Overrides:
accept
in classBlockLootTableGenerator
-
getName
- Specified by:
getName
in interfaceDataProvider
-