1

So I'm trying to create this villager that sells God apples and God Potions, but this command is so long that I can't find the error inside.

Here is the command:

summon Villager ~ ~1 ~ {Profession:3,CustomName:"PvP Villager",CustomNameVisible:1,Career:1,CareerLevel:42,CanPickUpLoot:0,PersistenceRequired:1,Invulnerable:1,Offers:{Recipes:[{rewardExp:false,uses:-2147483648,maxUses:0,buy:{id:gold_block,Count:8},sell:{id:potion,Count:1,tag:{HideFlags:32,CustomPotionEffects:[{Id:10,Amplifier:1,Duration:410},{Id:22,Amplifier:3,Duration:2400},{Id:11,Amplifier:0,Duration:6000},{Id:12,Amplifier:0,Duration:6000}],display:{Name:"Gods water",Lore:["Who knew water was so good!"]},{buy:{id:"diamond_block",Count:8},maxUses:9999999,sell:{id:"golden_apple",Count:1,Damage:1},rewardExp:false}}}}]}}

This is the output I get when I try to use the command. I was also getting errors on the brackets, but I may have fixed those.

Data tag parsing failed: Unable to locate name/value separator for string: {buy:{id:"diamond_block",Count:8},maxUses:9999999,sell:{id:"golden_apple",Count:1,Damage:1},rewardExp:false}

Thank you to anyone that can help me with this command! :)

2

Each recipe (containing a buy item and a sell item) should be in the Recipe list, looking something like:

Correct structure

Currently, you have the second recipe inside the data of the first recipe's sell item:

Incorrect location

The following data should work:

{
    Profession: 3,
    CustomName: "PvP Villager",
    CustomNameVisible: 1,
    Career: 1,
    CareerLevel: 42,
    CanPickUpLoot: 0,
    PersistenceRequired: 1,
    Invulnerable: 1,
    Offers: {
        Recipes: [
            {
                rewardExp: false,
                uses: -2147483648,
                maxUses: 0,
                buy: {
                    id: gold_block,
                    Count: 8
                },
                sell: {
                    id: potion,
                    Count: 1,
                    tag: {
                        HideFlags: 32,
                        CustomPotionEffects: [
                            {
                                Id: 10,
                                Amplifier: 1,
                                Duration: 410
                            },
                            {
                                Id: 22,
                                Amplifier: 3,
                                Duration: 2400
                            },
                            {
                                Id: 11,
                                Amplifier: 0,
                                Duration: 6000
                            },
                            {
                                Id: 12,
                                Amplifier: 0,
                                Duration: 6000
                            }
                        ],
                        display: {
                            Name: "Gods water",
                            Lore: [
                                "Who knew water was so good!"
                            ]
                        }
                    }
                }
            },
            {
                buy: {
                    id: "diamond_block",
                    Count: 8
                },
                maxUses: 9999999,
                sell: {
                    id: "golden_apple",
                    Count: 1,
                    Damage: 1
                },
                rewardExp: false
            }
        ]
    }
}

I'd recommend building up commands and testing them along the way, rather than starting with a long command and adding in brackets to try to fix the errors.

0

I would also recomend using this website https://minecraftcommand.science/shop-generator, here specifically linked to the villager shop page. Make sure to press the minify command button before you copy the command to prevent errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.