1

This question already has an answer here:

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?

marked as duplicate by galacticninja, Joachim, greg-449, Ivo Coumans, Virusbomb Aug 1 at 14:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Try merging the SkullOwner tag and the display tag into one section. I.e. {SkullOwner:...,display:...} – Ben Apr 5 '16 at 23:20
  • You are totally right ^^''. That was the issue. Thank you very very much – DerpSnake Apr 5 '16 at 23:30
  • Ok, no worries. Like I have said, I have added this as an answer, so if this solved your problem, you can click the "accept answer" (The tick on the left hand side), so others can hopefully find the solution if they're having similar issues. Additionally, try not to load up the comment section with too many comments ;) – Ben Apr 5 '16 at 23:37
2

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
        }
    ]
}

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