What's wrong with my give command? [duplicate]

What's wrong with my give command? [duplicate] - Cheerful crop African American female owner giving treat to Labrador Retriever while teaching commands in park

I want to give myself a box that makes me invisible to mobs while wearing it. ''It'' is a skull of my second account that is textured as a Cardboard Box :)

Command:

/give @p minecraft:skull 1 3 {SkullOwner:DerpBox}{
    display: {
        Name: "DerpBox",
        Lore: [
            "Who needs state-of-the-art Technology",
            "when you got a Box"
        ]
    },
    AttributeModifiers: [
        {
            AttributeName: "generic.followRange",
            Name: "generic.followRange",
            Amount: -100,
            Operation: 0,
            UUIDMost: 62168,
            UUIDLeast: 860927
        }
    ]
}

I get an error saying

Encountered multiple top tags, only one expected

How can I fix this?



Best Answer

I believe the problem is that you have both the SkullOwner tag and the display tag in different sections. Since the SkullOwner, display, and Attribute sections are all NBT tags, these should all belong to the same block.

According to the wiki, these should all be combined into one section, like so:

/give @p minecraft:skull 1 3 {
    SkullOwner:DerpBox,
    display: {
        Name: "DerpBox",
        Lore: [
            "Who needs state-of-the-art Technology",
            "when you got a Box"
        ]
    },
    AttributeModifiers: [
        {
            AttributeName: "generic.followRange",
            Name: "generic.followRange",
            Amount: -100,
            Operation: 0,
            UUIDMost: 62168,
            UUIDLeast: 860927
        }
    ]
}



Pictures about "What's wrong with my give command? [duplicate]"

What's wrong with my give command? [duplicate] - A Girl Feeding Her Dad
What's wrong with my give command? [duplicate] - A Girl Smiling While Holding a Red Christmas Sweater
What's wrong with my give command? [duplicate] - Dad and Daughter Unboxing a Christmas Present





Rnbstylerz \u0026 AREES - WHAT




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Samson Katt, cottonbro, cottonbro, cottonbro