Changes

Line 105: Line 105:  
</syntaxhighlight>
 
</syntaxhighlight>
 
=== The LootPool Builder ===
 
=== The LootPool Builder ===
This is where you actually make a loottable. If you have multiple blocks with similar loottables, making a general method could be a good idea. The Method should return a LootTable.Builder. This builder can be made by using the LootPool.lootPool() method, but you still need to add attributes. You need a name for the pool, the amount you get and also "what" you get. The "what" can modified using functions or conditions (see https://minecraft.fandom.com/wiki/Loot_table for possible vanilla funtions and conditions). After having made the builder, you return LootTable.lootTable().withPool(builder). A example of a "shulkerbox-like" block, copying its name, inventory and "energy" data to the block and restoring its contents.
+
This is where you actually make a loottable (this is an explanation for a block loottable). If you have multiple blocks with similar loottables, making a general method could be a good idea. The Method should return a LootTable.Builder. This builder can be made by using the LootPool.lootPool() method, but you still need to add attributes. You need a name for the pool, the amount you get and also "what" you get. The "what" can modified using functions or conditions (see https://minecraft.fandom.com/wiki/Loot_table for possible vanilla funtions and conditions). After having made the builder, you return LootTable.lootTable().withPool(builder). A example of a "shulkerbox-like" block, copying its name, inventory and "energy" data to the block and restoring its contents.
 
<syntaxhighlight lang="java">
 
<syntaxhighlight lang="java">
 
protected LootTable.Builder createTable(String name, Block block) {
 
protected LootTable.Builder createTable(String name, Block block) {
Line 122: Line 122:  
     }   
 
     }   
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
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
 
[[Category:Data Generation]]
 
[[Category:Data Generation]]
25

edits