Minecraft / Blogs

A Basic Guide to 1.14 Datapacks and Loot Tables

  • 1 diamonds
  • 95 views, 2 today
  • 1 comments
  • 0 favorites
  • 1
  • 0
  • comment1
  • playlist_add
  • share
  • more_horiz
avatar BubblesAndSuch
Level 13 : Journeyman Taco
9
This is a simple guide on how to get started with loot tables in 1.14 versions. There have been several changes to loot table it seems between 1.12, 1.13, and 1.14. After messing around for hours I finally got a basic loot table working where I could spawn a few custom drops.



My primary goal have the command /loot spawn ~ ~ ~ loot Custom_Ores:test spawn a custom set of items. This isn't an advanced tutorial as it doesn't go into the advanced specifics of how the loot is set up or ways the loot tables can be used. It is just to help people get a datapack and loot table started in 1.14

Here's how I did it:




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.



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.



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.



More items and options can be added to loot tables like weights and amounts.

Online tools like below can help create loot tables. NOTE: these tools are outdated and do not include the newer required [type] tag.
https://amaury.carrade.eu/minecraft/loot_tables
http://minecraft.tools/en/loots.php



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

Here is a page showing all the possible fields in a loot table file. The guide is outdated at 1.12, but still could be useful: https://github.com/skylinerw/guides/blob/master/java/loot%20tables.md

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)


In all the json type text files Minecraft uses, it is VERY important to keep the spaces on each indent exact. The standard is 2 spaces per indent. If I recall correctly, tabs cannot be used.



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

Comments : 1

star Login or register to post a comment.

Show Comments

1 - 1 of 1

1 - 1 of 1

Show Comments

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome