The easiest way to find mismatched braces is to expand the command into a multi-line format with properly indented lines. This makes it easier to find errors and subsequently fix them.
A nifty little tool to automatically format your data tags can be found at http://jsonviewer.stack.hu/. Using the Format and Remove White Space buttons, you can expand or collapse your command, respectively. Using the sample data tag given in the questions, we can turn this
{Profession:3,Career:2,Offers:{Recipes:[{buy:{id:minecraft:diamond,Count:6b}},sell:{id:minecraft:diamond_hoe,tag:{ench:[{id:16s,lvl:10s}]}]}}
into this
{
Profession: 3,
Career: 2,
Offers: {
Recipes: [
{
buy: {
id: minecraft: diamond,
Count: 6b
}
},
sell: {
id: minecraft: diamond_hoe,
tag: {
ench: [
{
id: 16s,
lvl: 10s
}
]
}
]
}
}
Now all that is left is compare the opening and closing brackets at each indentation level. You can see that there is no closing bracket at the last indentation level, the last bracket is indented once, showing us that there is a closing bracket missing on some level.
If you check all the tags starting at the top, you can see that there's a problem with the sell
tag: There's a closing square bracket instead of a curly bracket on that indentation level. To make this even more visible, we can copy-paste our data tag into an advanced text editor like Notepad++, which highlights matching brackets for us:
Have the missing curly bracket problem:
Here it is immediately apparent that a closing curly bracket is needed for the sell
tag.
Without the missing bracket:
It may be a possible glitch. If it's not then it may be possible that you might have not filled the proper criteria for slime as they should be able to be spawnedin the right criteria. Try spawning them in a light level less than 7 and between height 40 and 70. If it is not a swampland, you will need to rely on chance to find particular chunks that can actually spawn slimes. Else, it may be a bug.
Actually, you can find out the location of the slime chunks but it is very hard and will need heavy math.
Here are the code functions you can play with to find these slime chunks:
Random rnd = new Random(seed +
(long) (xPosition * xPosition * 0x4c1906) +
(long) (xPosition * 0x5ac0db) +
(long) (zPosition * zPosition) * 0x4307a7L +
(long) (zPosition * 0x5f24f) ^ 0x3ad8025f);
return rnd.nextInt(10) == 0;
I hope this answer helps you!
Best Answer
Each entity has only one data tag. It does not mean you cannot use different data in it.
Data tag in Minecraft is described in NBT format, textual representation of which is somewhat similar to JSON. Basically, it consists of compounds and arrays.
So, a data tag is a NBT compound. When it is empty, it looks like
{}
. To that compound, you add properties:Equipment
,CustomNameVisible
, etc.Attributes
is just another property, so you can add it with a comma to outermost braces, like that: