Talk:Loot table

luck_multiplier
Looking through the code, it appears that the variable is supposed to vary the weight of the item based on some input variable (which we may as well call "luck"): the formula is. But it looks like in all cases the "luck" input is currently zero. Anomie x (talk) 12:40, 23 October 2015 (UTC)


 * I would assume that is related to the Potion of Luck Dinnerbone mentioned. The idea is things like potions and enchantments could affect loot even from chests. – KnightMiner  t/c 13:28, 23 October 2015 (UTC)

set_damage
The information on the page is true, tested in 15w43c. 84.10.230.247 11:57, 24 October 2015 (UTC)


 * Thanks for testing that. I removed the verify tag. – KnightMiner  t/c 15:22, 24 October 2015 (UTC)

"Modded/Custom Maps"
Just wanted to point out that custom namespaces ("thaumcraft" from the example) will work. Loot tables are already set up for mods and custom maps. However, I'm not sure how to rewrite it since there's a lot of redundancy or false information; there probably doesn't need to be two separate sections. We are expected to not use the "minecraft" namespace unless we're specifically overwriting the default tables. As such, we should not be adding new tables inside "minecraft", but rather inside our own namespace ("thaumcraft", "custom_vanilla_map", "skylinerw_tests", etc). I have examples of usage here if needed. Skylinerw (talk) 07:39, 28 October 2015 (UTC)
 * If we need to mention mods at all (IMO we probably don't, we don't mention mods in most other places on the "main" wiki), something like this should do: Loot tables for mods will similarly go into paths under the data/loot_tables/ directory, e.g. the loot table for a "Scary dude" in "MyCoolMod" might go in data/loot_tables/mycoolmod/scarydude.json with LootTable set to "mycoolmod:scarydude". See each mod's documentation to determine which loot table names are used by default. Anomie x (talk) 10:36, 28 October 2015 (UTC)


 * I mean more in general terms, since custom loot tables are not restricted to mods. As it stands, the page implies you have to use the "minecraft" namespace to add new table, which is incorrect (and it's not recommended to do that). But there's still usage with the "minecraft" namespace to replace default tables, so the current "Custom maps" section does mention it correctly. I'm just not particularly good at wording something for a wiki! Skylinerw (talk) 11:02, 28 October 2015 (UTC)


 * I wrote the original "custom maps" section. I moved all the content into the Usage section and changed it to talk about namespaces. I'm new at this, though, so tell me if I did anything wrong. Update: I also just noticed I can't remove the old section because I'm a new user. --Kittycat3141 (talk) 11:16, 28 October 2015 (UTC)

What's the difference?
I don't know the difference between LootTable and LootTableSeed. I assume that LootTable lets you input your table right then and there, and LootTableSeed would be the pre-existing table you wish to use. However, a useful site tells that LootTable would be a pre-existing table, mainly tables that exist in that world. Could someone please tell me which one is which? The site is minecraft.tools. Fyreboy5 (talk) 20:41, 2 December 2015 (UTC)
 * LootTable is which loot table should generate the random loot, and LootTableSeed is a seed in the sense that it seeds the random number generator (see also wikipedia:Random_seed), much the same idea as the seed of a minecraft world. Each different seed will generate different loot from a given table. Make more sense? – Sealbudsman talk/contr 20:57, 2 December 2015 (UTC)
 * No. I want to know if it is possible to set a chest with a loot table without going into the file, so I think that LootTableSeed would let me create one exactly, as to minecraft:diamond_chestplate. Fyreboy5 (talk) 13:17, 4 January 2016 (UTC)
 * If you define LootTableSeed, then that chest and any with the same seed will always have the same contents, the main point is to make sure Minecraft world and custom maps always have the same loot.
 * So you can add a chest with the loot table using, though if you want specific contents all the time (rather than starting with random ones) it might be easier to just a filled chest. – KnightMiner  t/c 15:31, 4 January 2016 (UTC)
 * I want it to be random every time I open the chest, but I have a new idea how. RawLootTable and RawDeathLootTable will allow you to make a loot table for that mob or container in the command itself. If applied to a mob or container with another LootTable or DeathLootTable, it will roll so that 50% would be LootTable, and 50% would be RawLootTable. The way to put it in is to do it the same way as adding it to maps, but with the setblock or summon command in front, and no quotations. Fyreboy5 (talk) 18:09, 14 January 2016 (UTC)
 * This isn't the place for suggestions. For that, you want https://www.reddit.com/r/minecraftsuggestions. Anomie x (talk) 22:55, 14 January 2016 (UTC)
 * Thank you. I will suggest. Fyreboy5 (talk) 15:15, 28 January 2016 (UTC)

It is unclear that what is the order of application of functions.
111.194.108.33 12:28, 23 February 2016 (UTC)

List of loot tables link dead
There is a list in the "data packs" section to a list of loot tables. That takes you back to this page. Where is that list now?

5.71.59.57 14:07, 4 May 2019 (UTC)


 * It's collapsed (click the "Show" button to see it) in the section directly above. --AttemptToCallNil (report bug, view backtrace) 14:24, 4 May 2019 (UTC)

Ore Drops Formula
I can't seem to understand what the ore drops formula is. It says. However, this doesn't make sense. What I understand is. Wouldn't this always result in just the count? I'd love if someone could help me out, and I also think the formula needs rewriting on the main page to make it more easily understood. -PancakeIdentity (talk) 17:34, 9 June 2019 (UTC)

tool_enchantment
is under conditions, but from the description of how it works, it sounds like it belongs under functions. I can't find it used anywhere in the vanilla datapack for comparison. Can someone check where this belongs? --NickNackGus (talk) 00:11, 13 July 2019 (UTC)

I've read it over again, and now it makes sense as a conditional and as a function.

The part that confused me was "List of enchantments that need to be applied to the tool." This can be read as: Can anyone think of a less ambiguous, but not too verbose way of writing this? --NickNackGus (talk) 03:14, 13 July 2019 (UTC)
 * Stating an action that is to be taken: "List of enchantments that need to be applied to the tool by this function." This makes sense if the loot table contains a tool, and we are trying to enchant it.
 * Stating a description that must be true: "List of enchantments that need to be applied to the tool used to generate this loot table." This makes sense if we're using a tool to get items from a loot table, such as killing a mob with a sword, or breaking a block with a tool.


 * Seems like you've written it yourself, "List of enchantments that need to be applied to the tool to generate this loot table". -PancakeIdentity (talk) 03:18, 13 July 2019 (UTC)

Binomial distribution of rolls
I found in a loot table generator that rolls can also have binomial distribution. I haven't tested in game yet. Should I add that to the JSON format?--ManosSef (talk) 08:14, 26 April 2020 (UTC) Now I just found that all min-max values can also have binomial distribution. I will test in game.--ManosSef (talk) 08:25, 26 April 2020 (UTC)

Bedrock Edition
This page currently only covers Java Edition, while bedrock has loot tables too, it also has no exclusive template or link to a bedrock loot table page. Somebody mind adding the into/link? (I have no idea if the wiki has it at all) FVbico (talk) 16:04, 3 May 2020 (UTC)

tool_enchantment again
Misode in his loot table generator has not added this condition because as he said: "from my testing it appears this condition never made it to the final release". Maybe I will test it and remove it, but do not revert if I do. ManosSef (talk) 20:07, 23 June 2020 (UTC)

Formula to calculate the loot tables
Hello, I would like to know what is the formula to calculate the loot tables, I am creating a loot table and I would like to know the probability of each loot -Syhix
 * Hi, is there a part of the page that is unclear? Or is the info you seek missing from the page proper? If you could provide more detail on what you're looking for, that would help us figure out what to do. ExpertCoder14 (talk) 06:56, 4 March 2022 (UTC)
 * Hello, I would like to know the method of calculation to find the percentage of each item in a chest. For example, the chests of the Ancient City. SyhixTV (talk) 13:28, 4 March 2022 (UTC)

Custom Loot Table on Server
What path should I use to overwrite the loot tables on a server? For example, if I'm trying to override the fishing treasure table, do I make a file called treasure.json, and place it in [world]/data/minecraft/loot_tables/gameplay/fishing/? Or does it belong somewhere else? The article goes into great detail about how to modify aspects of loot tables, but I'm unclear as to where to put the relevant json file. 71.11.176.25 03:52, 7 July 2022 (UTC)
 * I think you would need to create a data pack. The file needs to be in a pack and in the right location, something like . The wiki page should get you pointed in the right direction. - AD OffKilter (talk) 04:12, 7 July 2022 (UTC)
 * Ok, that's helpful! So should the path be [world]/datapacks/[datapack name]/data/minecraft/loot_tables/gameplay/fishing/?  71.11.176.25 04:21, 7 July 2022 (UTC)
 * I tried it but the server doesn't seem to recognize it as a valid datapack? 71.11.176.25 05:25, 7 July 2022 (UTC)
 * Hard to say. I just tried to make a pack here and replace fishing loot and it did work. Make sure you have the .mcpack file in [world]/datapacks/[datapack name] as mentioned on the data pack page. Inside that folder put the directory you pointed out above (data/minecraft/loot_tables/gameplay/fishing). The files must be named fish.json/treasure.json/junk.json. In my test I replaced all fish with just an item frame. If the pack is well-formed, it should in the list generated by . I'm not sure if you can change the % of which file it pulls from. - AD OffKilter (talk) 06:46, 7 July 2022 (UTC)
 * What I didn't understand is that editing loot tables REQUIRES making a datapack, and datapacks require making a .mcpack file, so in order to edit loot tables you have to make that .mcpack file. I understand now!  I think this article could be a little clearer on that all such changes require making a datapack.  71.11.176.25 20:55, 7 July 2022 (UTC)

Planned refresh upcoming to this page
It seems like this page has been edited to change the term &ldquo;loot table entries&rdquo; to the term &ldquo;loot pool entry producers.&rdquo;

These are terms that I don't recognize in the context of loot tables. It has been customary to always refer to them simply as &ldquo;entries.&rdquo;

As an experienced data pack developer, I plan to update this page similarly to how I have done so to the Predicate and Item modifier pages. I plan to revert this change in terminology as well as update the sections to look similar to those of the pages I have already refreshed. I may also choose to refine the treeview of the loot table fields, similarly to how I have refined those of Advancement/Conditions/entity and similar pages.

If there is any reason to why the term &ldquo;loot pool entry producers.&rdquo; should be kept, please let me know. Until then, more details of my works are to be announced.

Regards, ExpertCoder14 (talk) 18:03, 15 July 2022 (UTC)


 * I was going to revert those because they were being added without explanation, but I was not familiar enough with the subject to revert edits made by someone who seemed more familiar. If they are wrong, then by all means revert them. We cannot have incorrect information here. Amatulic (talk) 18:45, 15 July 2022 (UTC)
 * Thanks for your input. It is possible that &ldquo;loot pool entry producers&rdquo; is the name used in the game's code to refer to these items, similar to the terms &ldquo;loot condition &rdquo; and &ldquo;loot function,&rdquo; and the latest edit was made to make the article reflect that. However, the wording of the wiki should, in most cases, be the one that is accurate while still being easy to understand, not bent over backwards to appease the wording in the source code. Therefore, I'll revert the latest edit and invite the editor to join the discussion if they like. ExpertCoder14 (talk) 04:36, 16 July 2022 (UTC)
 * While I've not heard the specific term 'loot pool entry producers', I do know that internally there is a concept of loot pools and loot pool entries. That said, I don't know if it's warranted to be that specific on this page or not. - AD OffKilter (talk) 19:14, 15 July 2022 (UTC)
 * In the context of loot tables, loot tables are comprised of pools, which each contain entries. The terms that would be the most intuitive, in my opinion, would be &ldquo;loot table pool&rdquo; and &ldquo;loot table entry&rdquo;, making it abundantly clear that these items are present in loot tables and loot tables only. ExpertCoder14 (talk) 04:38, 16 July 2022 (UTC)


 * I changed the term &ldquo;loot table entries&rdquo; to the term &ldquo;loot pool entry producers&rdquo; because they are not entries. And they cannot be called "entries" anyway.
 * If you are an experienced data pack developer, you can notice that the "weight" field doesn't take effect in "sequence", "alternatives" or "group". And, in the child of their "children" list, the "weight" field sometimes takes effect.
 * It's because that weight is applied on entries, instead of entry producers. When looting from a pool, in each roll, these entry producers will produce entries into the pool. Then one entry (rather than entry producer) is chosen as a weighted random selection from all entries in this pool. Producers with the type of "item", "tag", "loot_table", or "dynamic" will produce one or multiple entries with the specified weight into the pool. And "sequence", "alternatives" and "group" are special entry producers: they provides other entry producers (in their "children" list) instead of entries.
 * Only if we understand that "weight" is the weight of the entries in the pool, instead of entry producers in the json list, can we control the chance of each item stack being dropped, especially when "sequence", "alternatives" or "group" is used.
 * So I revert your edit, If you're still unclear, you can ask me and I can provide you some examples.--Chixvv (talk) 17:03, 25 July 2022 (UTC)
 * And fyi, they are called "loot entry" and "loot entry container" in the games's code. I called it "loot entry producer" because it's more aaccurate and easy to understand.--Chixvv (talk) 17:21, 25 July 2022 (UTC)