Wiki 9Minecraft Doomlike Dungeons Wiki
Doomlike Dungeons WikiDocumentation › Custom Nbt For Loot Items

Custom Nbt For Loot Items

The new way (for Minecraft 1.19.4 and later)

Good news, as long as you know how to make data packs its easier. There is no nbt.cfg with these versions.

Inside the data pack, create a folder data/dldungeonjbg/theming/nbt.

In that folder place files with snbt strings you need; these files should contain nothing but the snbt. Each file will become a tag that can be used on items in your chest files (also now in the data pack) withe name dldungeonsjbg: where is whatever you named the file. The name of the file should only contain lower case Latin letters, numbers, and the underscore -- and whatever you do, absolutely NO spaces.

If you are using the NBT Exporter mod, the files it produces with /exportnbtstr can be dropped straight into the folder (as long as they are named correctly; the name it suggests is usually not good).

The Old Way (for Minecraft 1.12.2 and earlier)

The nbt.cfg file allows you to define NBT data that can be added to chest loot (only, at least so far). There are two ways to do it, the good way and the hard way. Either way you will define a code that can be used in chest/loot files to give special properties to item.

The Good Way

Warning: This is a newer feature and does not work in some older versions (such as for Minecraft 1.7.x); if the default nbt.cfg does not start with a json your version does not support json.

HEALTH1 Json {Potion: "minecraft:healing"}

Here HEALTH1 because the label that is needed in chests.cfg (or another loot file). Json just tell you are using the JSON method. The rest, found between the curly braces, is interpreted by Minecraft in a standard way the game uses to get NBT from JSON.

For defining entire NBT tags in one go, the JSON "type" can be used. To define a tag, copy the output of a command like "/blockdata <x> <y> <z> {}", pointed at a chest containing desired items, then put the NBT tag of the item you want to copy.

The Hard Way

This is my homebrew mess of a system, made up because I didn't know there was a better option. Its best avoided, as it can easily crash the game (I've done it, and then stopped using it). Each line starts with a label, followed by a code for the tag type, then the data that should go in it. Nested data is done by previously created labels as data to store in the new tag, and so on. Codes exist for all NBT tag types, plus a couple fake type: One to as a helper to create enchantments and one to aggregate tags that are not contained in an actual list or compound.

I make two items the hard way, if you want to look in the file and see them. Yeah, it's a mess of a system.