- 19,860 views, 0 today
- 8
- 2
- 16
26
About
This is a simple guide on how to get started with loot tables in 1.14+ versions. There have been several changes to loot tables between 1.12, 1.13, and 1.14. After fiddling around for hours, I finally got a basic loot table working where I could spawn a few custom drops.
My primary goal is to setup the command /loot spawn ~ ~ ~ loot Custom_Ores:test to spawn a custom set of items. This isn't an advanced tutorial. It doesn't go into the advanced specifics of how the loot tables are set up or the various ways to use them. It is just to help people get a datapack and loot table started in 1.14
Here's how I did it:
Preparing the Pack
To start off, you need to create a datapack in your world file. Locate your saved world and create the following folders highlighted in bold:
saves/WorldName/datapacks/<TestPack>/data/<Custom_Ores>/loot_tables
Replace the names in <> with what ever you prefer
TestPack is the name of the data pack. Later you can use /datapack list to see if the pack is loaded
Custom_Ores is a NameSpace. They contain all the loot tables inside it. You can create multiple NameSpace folders to organize your tables.
Creating the Meta Data
In the TestPack folder create a file named pack.mcmeta and put the following text inside it: https://pastebin.com/MgaFB6Uh

The description can be anything you want.
Creating a Loot Table
Now, in the loot_tables folder, create a file called test.json with the following text: https://pastebin.com/jeXyyxCp

This creates a basic loot table that spawns an iron ore. More loot tables can be made the same way just with different names.
To insure your JSON file is formatted correctly, use an online JSON syntax checker like https://jsonformatter.curiousconcept.com/ or https://jsonchecker.com/
How to Use
To check if a datapack is loaded use:
/datapack list
To reload datapacks without closing and restarting the world use:
/reload
The command to spawn the loot table as a drop is:
/loot spawn x y z loot NameSpace:LootTable
Or in our case:
/loot spawn ~ ~ ~ loot Custom_Ores:test
Some More Things
More items and options can be added to loot tables, like weights and amounts.
Online tools, like below, can help you a little to create loot tables. NOTE: these tools are outdated and do not include the newer requirements for loot tables.
https://amaury.carrade.eu/minecraft/loot_tables
http://minecraft.tools/en/loots.php
Here is a page showing all the possible fields in a loot table file. The guide is outdated at 1.12, but still can be useful if you know how to apply it to a 1.14+ datapack: https://github.com/skylinerw/guides/blob/master/java/loot%20tables.md
Here is another guide on datapacks:
https://datapackcenter.com/projects/loot-tables.72/
Using Minecraft as the namespace will replace the vanilla loot tables with your own. I have not tested this as of yet myself, but from what I understand, to successfully replace the vanilla loot tables you must perfectly mirror the folder structure and loot table names from in the minecraft.jar file. (it can be found in you versions folder at version.jar/data/minecraft/loot_tables)
This isn't a very through tutorial, as I'm still learning it myself, but I hope it gets people started in the right direction with the new datapack features in 1.14.
If you have any questions I'll try my best to answer them.
Tags |
2 Update Logs
Update #2 : by BubblesAndSuch 12/27/2019 12:31:27 amDec 27th, 2019
Updated some info and fixed a dozen grammar mistakes.
Added Picture
Added Picture
LOAD MORE LOGS
4274270
6
Create an account or sign in to comment.
this is my loot table for the husk:https://pastebin.com/JSLXgT8b
the "minecraft:entities/extra/husk" loot table is the follow:https://pastebin.com/fvFA7Hni
when i use the loot command whit the extra/husk give me the sand but when i kill a husk it get me the vanilla stuf whitout the sand
even if put the sand entry and not the loot table whit the sand is the same...
is possible there is some conflict whit other datapack or there is something wrong?
Try moving the extra loot tables out of the vanilla folders to something like "saves/WorldName/datapacks/customtables" . I don't know if the game treats it differently that way, but I feel like that may be part of the problem.
If you still can't get it to work properly, here's what I would try:
- Get a brand new empty world to experiment on.
- Replace the vanilla loot table of the Husk and make it drop 1 stone. Just a single stone and nothing else.
- Kill a Husk to confirm it works.
- Create a folder with a simple loot table that drops 1 log and nothing else. (Like in my guide)
- Use the command to drop that 1 log: /loot spawn x y z loot CustomTables:LogDrop
- If both are working on there own, then procide
- Replace the stone in the Husk loot table with the name of the loot table that has the log. (Like you did with the sand) "name": "CustomTables:LogDrop"
- Try killing a Husk again.
Hopefully this will allow you to find out step by step, what you had wrong.{
"function": "furnace_smelt",
"conditions": [
{
"condition": "minecraft:entity_properties",
"predicate" : {
"flags" : {
"is_on_fire": true
}
},
"entity" : "this"
}
]
},
Just replace the whole function. Works only for 1.14.X
If you are still wanting to fix the data pack, Here's LeonidasTLM's suggestion with proper formatting:
https://pastebin.com/DWiwRrdg
I just tested my instructions in 1.14.4 and it worked fully. If you're still wanting to make it work. Double check the steps you took and make sure no text is missing from the JSON or mcmeta files.
Here's what I'm doing:
https://pastebin.com/Ya2GE3b2
And the loot table isn't even showing up in the options, if you can offer any help I would appreciate it.
(edit): also so far the other json objects I have created and working loot tables have also used tabs so it's not that.
If you're still trying to fix it, the problem is in your JSON syntax. line 11 that says :
"weight": 1
should have a comma after it. Like so:
"weight": 1,