Roguelike Dungeons

Roguelike Dungeons

33M Downloads

Loot Customization and potions

ZacQuicksilver opened this issue ยท 7 comments

commented

(I hope I'm not missing something because I'm new to making modpacks and still learning Git)

The lloot customization demo files contains a set of potions using the old metadata; rather than the new NBT tags. If you copy the files in without editing them (Minecraft 1.10.2), it gives non-functional items.

I tried replacing the data with each of the following formats, and none worked:

{"data" : {"name" : "potion", "nbt" : {"potion" : "healing"}}}
{"data" : {"name" : "potion", "nbt" : {"potion" : "minecraft:regeneration"}}}
{"data" : {"name" : "potion", "nbt" : {Potion : "swiftness"}}}
{"data" : {"name" : "potion", "nbt" : {Potion : "minecraft:strength"}}}
{"data" : {"name" : "potion", "nbt" : {potion : "invisibility"}}}
{"data" : {"name" : "potion", "nbt" : {potion : "minecraft:harming"}}}

I request that the loot settings demo file be updated to accurately include potions: ideally, one of the special potions that show up without the settings file (like Laudanum, Vile Mixture, etc.)

commented

I've been meaning to create special item generators so simplify stuff like this. Like
// creates a potion with both healing and swiftness
{"data" : {"type" : "potion", "effects" : [{"healing", 2}, "swiftness"]}}

// creates a potion with one effect
{"data" : {"type" : "potion", "effects" : {"healing", 2}}}

also could include various option tags like:
// create potion with multiple effects, which are hidden, and color set to purple.
{"data" : {"type" : "potion", "color": "8A2BE2", "hide" : "effects" : "effects" : [{"healing", 2}, {"swiftness"}]}}

I could see supporting all that and thus not needing a whole bunch of NBT

commented

Question: until that happens, how do I make potions?

commented

The general answer is that it's exactly the way described on this page:
https://github.com/Greymerk/minecraft-roguelike/wiki/Loot-Customisation

What i usually do is i download NBT explorer to reverse engineer items to find out their NBT structure.
https://github.com/jaquadro/NBTExplorer/releases

You may also try to produce them using the wiki as a guide, or at least for reference.
http://minecraft.gamepedia.com/Potion#Data_values

Here's how potions work now... their NBT structure is fairly complicated.

{
	"name" : "potion",
	"criteria" : {},
	"tower" : {
		"type" : "HOUSE",
		"theme" : {
			"base" : "OAK"
		}
	},
	"loot_rules" : [
		{
			"type" : "STARTER",
			"loot" : [
				{
					"data" : {
						"name" : "minecraft:potion",
						"nbt" : {
							"display" : { "type" : "COMPOUND", "value" : {
									"Name" : {"type" : "STRING", "value" : "My Potion"}
								}
							},
							"CustomPotionEffects" : {"type" : "LIST", "value" : {
								"type" : "COMPOUND", "value" : [
									{
										"Id" : {"type" : "BYTE", "value" : 3},
										"Amplifier" : {"type" : "BYTE", "value" : 1},
										"Duration" : {"type" : "INT", "value" : 300}
									},
									{
										"Id" : {"type" : "BYTE", "value" : 5},
										"Amplifier" : {"type" : "BYTE", "value" : 1},
										"Duration" : {"type" : "INT", "value" : 300}
									}
								]
							}},
							"CustomPotionColor" : {"type" : "INT", "value" : 16755200}
						}
					}
				}
			],
			"level" : [0, 1, 2, 3, 4],
			"each" : true,
			"quantity" : 2
		}
	]
}
commented

Actually. The following example also works, but for the sake of completeness it's good to know about the above as well. Both are valid, but one is more flexible.

{
	"name" : "potion",
	"criteria" : {},
	"tower" : {
		"type" : "HOUSE",
		"theme" : {
			"base" : "OAK"
		}
	},
	"loot_rules" : [
		{
			"type" : "STARTER",
			"loot" : [
				{
					"data" : {
						"name" : "minecraft:potion",
						"nbt" : {
							"Potion" : {"type" : "STRING", "value" : "healing"}
						}
					}
				}
			],
			"level" : [0, 1, 2, 3, 4],
			"each" : true,
			"quantity" : 2
		}
	]
}
commented

Okay, I'm going to make a more broad request here: I'm looking for a general guide on how to do NBT tags (I'm currently trying and failing to make a Botania Wand of the Forest, in addition to potions). If you can get me a general pointer on how to get those things working, I'll put together a new loot_settings_demo zip that includes metadata, nbt tags, etc.

commented

Thanks for that. I got everything working with your help.

I've attached an updated version of the loot-settings-demo.zip as found at https://github.com/Greymerk/minecraft-roguelike/wiki/Loot-Customisation; that adds three things:

  1. It updates the potions from the old metadata format to the new NBT tag based potions
  2. It includes a multi-effect potion that hides it's specific effects
  3. It adds some comments about what things do, and where to find information about how to change what they do.

I don't have access to upload the file and put it in the wiki, but if you could, that might help future modpack creators.

loot-settings-demo-1.10.2.zip

commented

I had some questions regarding custom loot configs that I wasn't able to answer from the Wiki, was hoping someone might have some feedback (Apologies if any questions seem obvious). I noticed in the demo files the loot.json uses an "inherit" to pick up the other config files, which is nice for keeping things in order/groups, my questions are:

  1. Whats the order/process of how json config files are loaded/found, will all json files in the config folder be parsed? is there any specific naming conventions i.e. there must be at lest one loot.json named file or could it be named anything.json?
  2. I see an "overrides" : ["LOOTRULES"] in the loot.json, what's the exact behavior of this? does it stop default loot configs from being used all together? and if so one should leave it out if you want the default plus any custom loot overwrites?
  3. is a "name" and "loot_rules" keys important? (first two keys in most demo json objects) could they be left out along with the "inherit" key if you had everything in just one json file?

Thanks in advance!

EDIT: Sorry if this is considered thread hijacking, just thought it was more follow on things relating to loot customization but I can create a new thread if needed.