Greymerk / minecraft-roguelike

This is a mod for minecraft that adds randomly generated dungeon complexes.
GNU General Public License v3.0
129 stars 53 forks source link

Can't specify the "meta" of the item. #213

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hello. I'm trying to add custom loot and I want to add various dyes and some items from other mods to the dungeon. For example, I'm trying to add a red dye:

{
    "name" : "demo:loot_all",
    "loot_rules" : [
        {
            "level" : [0, 1, 2, 3, 4],
            "loot" : [
                {"data" : {"name" : "minecraft:dye"}, "meta" : 1, "weight" : 1}
            ],
            "each" : true,
            "quantity" : 4
        }
    ]
}

But that does not work. In the dungeons, I still find an ink sac.

The same problem with mods. For example, I want to add a "copper ingot" from the Thermal Foundation, which has a meta "128":

{
    "name" : "demo:loot_all",
    "loot_rules" : [
        {
            "level" : [0, 1, 2, 3, 4],
            "loot" : [
                {"data" : {"name" : "minecraft:dye"}, "meta" : 1, "weight" : 1},
                {"data" : {"name" : "thermalfoundation:material"}, "meta" : 128, "min" : 8, "max" : 28, "weight" : 1}
            ],
            "each" : true,
            "quantity" : 4
        }
    ]
}

But in the dungeons, anyway, I find not a copper ingot, but "Pulverized Ingot", which has meta "0": https://prnt.sc/sy4qlv

What am I doing wrong?

ghost commented 4 years ago

I'm dumb. The problem is resolved. I set brackets in the wrong place.

I set it correctly and now everything works fine: {"data" : {"name" : "thermalfoundation:material", "meta" : 128}, "min" : 8, "max" : 28, "weight" : 1}