Changes

Line 105: Line 105:  
</syntaxhighlight>
 
</syntaxhighlight>
 
=== The LootPool Builder ===
 
=== The LootPool Builder ===
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 <code>LootTable.Builder</code>. This builder can be made by using the <code>LootPool.lootPool()</code> 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 and/or conditions (see [https://minecraft.fandom.com/wiki/Loot_table LootTables] for possible vanilla funtions and conditions). After having made the builder, you return <code>LootTable.lootTable().withPool(builder)</code>. 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 <code>LootTable.Builder</code>. This builder can be made by using the <code>LootPool.lootPool()</code> 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 and/or conditions (see [https://minecraft.fandom.com/wiki/Loot_table LootTables] for possible vanilla funtions and conditions). After having made the builder, you return <code>LootTable.lootTable().withPool(builder)</code>. 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) {
25

edits