How do loot tables work
Write for Game Developer. Blog Now. Connect Close Back. Register for a. Get daily Game Developer top stories every morning straight into your inbox.
About Us. Advertise With Us. Report An Issue. Subscribe Login. A minimum of 3 characters are required to be typed in the search bar in order to perform a search. You can put as many pools as you want in one loot table. Add loot table pool: Add a new pool in the loot table. You can put it to 0. Bonus roll s : The bonus rolls are an optional option used to add a possibility to give more rolls to a specific pool.
The min and max work the same way than before. Affected by fortune: This setting defines if the entry is affected by the fortune enchantment. Enable explosion decay: This setting defines if the entry is affected by the explosions.
Silk touch mode: This setting defines how the entry reacts with or without silk touch. Entry enchantment min and max: The minimal and maximal level of enchantments on the entry.
Enchantments are random. To use a loot table for a chest or another block with storage like the Barrel you need to execute the following command. By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. Otherwise, a name must be specified in modded entries, and is automatically generated for vanilla entries.
For each repeat, a number is incremented. For example, if there are three entries in a vanilla pool each with name: "minecraft:stick" , then the three entryName tags generated would be minecraft:stick , minecraft:stick 0 , and minecraft:stick 1. Likewise, removing an entry does not shift the names of the other entries. Next, an example of one of the most common use cases for modifying vanilla loot: adding dungeon item spawns.
The most flexible and simple solution is to add another pool with a single loot entry referencing your own loot table JSON, because loot entries are able to recursively draw from a completely different table. Other params set as you wish. Of course, if the loot you want to add cannot be determined ahead of time, you can freely construct and add LootPool s and implementations of LootEntry in your event handler similar to the calls shown above.
A real-world example of this approach in action can be seen in Botania. The event handler is located here , and the injected tables are located here. Subclasses of EntityLiving automatically support drawing from a loot table upon death. This is done by overriding the getLootTable method to return a ResourceLocation to the desired table. Occasionally, you may want to generate ItemStack s from a loot table from your own code. Next, create a LootContext using the provided LootContextBuilder , which holds information about the context of the looting, such as the killer, luck of the looter, and finishing blow.
Builder world. Or to fill an inventory: table.
0コメント