tutorial:datagen_loot
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:datagen_loot [2023/06/05 17:30] – Add comments inside onInitializeDataGenerator to be consistent with other data generation tutorials on the wiki mcrafterzz | tutorial:datagen_loot [2023/06/16 17:29] (current) – 1.20+ addProvider change slainlight | ||
---|---|---|---|
Line 26: | Line 26: | ||
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { | public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { | ||
// ... | // ... | ||
- | fabricDataGenerator.addProvider(MyBlockLootTables:: | + | |
+ | myPack.addProvider(MyBlockLootTables:: | ||
// ... | // ... | ||
} | } | ||
</ | </ | ||
+ | |||
+ | If you're using versions pre-1.20, please replace '' | ||
Let's just create a simple ore block and an item to drop from it for a block loot table. Add this to your block init or '' | Let's just create a simple ore block and an item to drop from it for a block loot table. Add this to your block init or '' | ||
Line 70: | Line 73: | ||
private static class MyChestLootTables extends SimpleFabricLootTableProvider { | private static class MyChestLootTables extends SimpleFabricLootTableProvider { | ||
- | public MyChestLootGenerator(FabricDataGenerator | + | public MyChestLootGenerator(FabricDataOutput |
super(dataGenerator, | super(dataGenerator, | ||
} | } | ||
Line 89: | Line 92: | ||
@Override | @Override | ||
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { | public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { | ||
- | fabricDataGenerator.addProvider(MyChestLootTables:: | + | |
+ | myPack.addProvider(MyChestLootTables:: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | If you're using versions pre-1.20, please replace '' |
tutorial/datagen_loot.1685986229.txt.gz · Last modified: 2023/06/05 17:30 by mcrafterzz