AgriCraft

AgriCraft

30M Downloads

Question about tag formatting and the "item" condition

katubug opened this issue ยท 6 comments

commented

Hi! So, I'm trying to add a soil that has NBT data attached. However, I can't seem to figure out how the formatting for the tags value works.

"varients": [
    {
      "item": "example:item",
      "meta": 0,
      "tags": "",<----------this bit
      "ignoreMeta": true,
      "ignoreTags": [],
      "useOreDict": true
    }

I've tried just about every possible combination of syntaxes, likely or not, and nothing works. I can get it working if I completely omit the NBT data, but then it works on every version of the block, whereas I'd like to limit it to a kind with certain tags. Also I removed the "*" from the "ignoreTags" field because I don't want it to ignore tags - unsure if that makes a difference but it doesn't seem to.

My second question is about the plants jsons, specifically the "item" condition.

      {
        "amount": 1,  # The amount required in the given range.
        "min_x": 0,   # The bounding box, relative to the crop at 0, 0, 0 in which the block(s) are to be placed.
        "min_y": -2,  # In this case we specify the box {(0, -2, 0), (0, -2, 0)}, which is the single block directly
        "min_z": 0,   # below the soil block. Notice that the upper bound is inclusive, so that to specify a
        "max_x": 0,   # single block we use the same point twice, not the upper left and lower right points.
        "max_y": -2,
        "max_z": 0,
        "item": "minecraft:gold_ore", # This part specifies information about the block required.
        "meta": 0, # This is a *direct* extension of an AgriStack meaning that it has all the same fields as
        "tags": "", # would be found on say the seed_items field.
        "ignoreMeta": true,
        "ignoreTags": [],
        "useOreDict": true
      }
    ]

I don't understand what "block required" refers to. Is the gold the block that the crops are planted on? That has to be nearby? Do you right-click the gold onto the crop sticks?

Thank you very much for your time!

commented

I guess this is solved then?

Not really. There is still question about "tags": ""
I have same problem, can't figure out how to make crop grow only on block with certain NBT data.
Is there a way to make (for example) so crop only grow on Energy Cell with more then 10000 RF in it?

commented

If this is for 1.12, then I don't know.
If it's for 1.16, then no, tags for blocks have not been implemented.

commented

Thanks so much, that explains it perfectly. I appreciate you taking the time to give me such a thorough explanation!

I'm not at my computer right now, but when I get there I'll add some more detail to my question about nbt.

commented

"item" must found in the space indicated by the coordinates specified. So in this case, as the comments note, the bounding box is indicating the block below the farmland soil block. So it must be a gold_ore block in this case, like so:

Y 0 : crop stakes
Y -1: farmland soil
Y -2: gold_ore

Not sure about the NBT tag question, sorry.

commented

To extend on my reply:

The "Item" condition you provided is interpreted as:

"Must find one minecraft:gold_ore block precisely at ~ ~ ~-2"

If min_y was -4 and max_y remained -2, then you could put the gold_ore at ~-2, ~-3, or ~-4; any of those locations would fulfill the condition.

If min_y was -4 and max_y remained -2 and you changed "amount" to 2, then at least two of those three blocks must be gold_ore, but at least one could be something random.

Y 0 : crop stakes
Y -1: farmland soil
Y -2: gold_ore
Y -3: dirt
Y -4: gold_ore

and

Y 0 : crop stakes
Y -1: farmland soil
Y -2: wool
Y -3: gold_ore
Y -4: gold_ore

would work, but

Y 0 : crop stakes
Y -1: farmland soil
Y -2: wool
Y -3: wool
Y -4: gold_ore

wouldn't because there's only one gold ore and "amount" says it needs 2.

When playing with "amount", make sure you've specified a search area large enough to hold that many - if you left the min_y and max_y set to -2 exactly, it will search only 1 block and therefore if you set any amount above 1, it can never find more than one block and it will fail.

It must be directly beneath, because the min_ and max_ x and z properties are set to 0. You can specify a bigger area to search in if you want.

commented

I guess this is solved then?
In the future please do not use this issue tracker for help with regards to how to use the mod, thanks!