Here's an example Lootprovider class for blocks. The class is abstract and will be extended by the actual lootprovider class. This is however, optional. The class could also be used directly.
+
Here's an example Lootprovider class. The class is abstract and will be extended by the actual lootprovider class. This is however, optional. The class could also be used directly.
<syntaxhighlight lang="java">
<syntaxhighlight lang="java">
public abstract class BaseLootTableProvider extends LootTableProvider {
public abstract class BaseLootTableProvider extends LootTableProvider {
Line 69:
Line 69:
Map<ResourceLocation, LootTable> tables = new HashMap<>();
Map<ResourceLocation, LootTable> tables = new HashMap<>();
for (Map.Entry<Block, LootTable.Builder> entry : lootTables.entrySet()) {
for (Map.Entry<Block, LootTable.Builder> entry : lootTables.entrySet()) {
Thanks and creddits to McJty with his amazing tutorials: https://wiki.mcjty.eu/modding/index.php?title=YouTube-Tutorials and https://github.com/McJty/YouTubeModding14/tree/1.16/src/main/java/com/mcjty/mytutorial/datagen
Thanks and creddits to McJty with his amazing tutorials: https://wiki.mcjty.eu/modding/index.php?title=YouTube-Tutorials and https://github.com/McJty/YouTubeModding14/tree/1.16/src/main/java/com/mcjty/mytutorial/datagen