-3

It's that command:

/give @p diamond_block 1 0 {display:{Name:"Extreme Route #1 Prize"},ench:[{id:20,lvl:27},{id:16,lvl:2727}],HideFlags:127}

And I want to add {CanPlaceOn:["quartz_stairs"]}.

But the command block is saying: Data tag parsing failed: Trailing data found at: ...},{id:16,lvl:2727}],HideFlags:127},<--[HERE]

The command works perfectly without the "can place on". What am I doing wrong?

2
  • You didn't actually put the problematic command in. Please do that, otherwise the answer will just be "add it after a comma". Commented Oct 26, 2017 at 10:49
  • You probably added the extra { } to your command while CanPlaceOn:[] belongs in the existing ones.
    – dly
    Commented Oct 26, 2017 at 12:09

2 Answers 2

0

The command you need is:

/give @p diamond_block 1 0 {display:{Name:"Extreme Route #1 Prize"},ench:[{id:20,lvl:27},{id:16,lvl:2727}],HideFlags:127,CanPlaceOn:["quartz_stairs"]}

(assuming both parts of your given command are correct in themselves, I didn't check that)

Since you didn't provide the problematic command, I can't tell you more about your problem. The error message looks like you had a closing bracket too much or maybe at the wrong position, but I can't say for sure.

0

You are adding the information outside of the data tag list.

Lets simplify the data portion of your original command and add a bunch of extra spaces for visual clarity:

{  display:{...}, ench:[...], HideFlags:127  }

A list with three items in it. When you added CanPlaceOn, you added it outside of that list like this:

{display:{...},ench:[...],HideFlags:127},   {CanPlaceOn:[...]}

This is why the error mentions trailing data. It noticed the list was done and there was extra stuff after the list. You want to add that CanPlaceOn inside the list as another list item like this:

{  display:{...}, ench:[...], HideFlags:127, CanPlaceOn:[...]  }

Now it is part of the list which makes up the data tag. A list with 4 items. Here is the correct command:

/give @p diamond_block 1 0 {display:{Name:"Extreme Route #1 Prize"},ench:[{id:20,lvl:27},{id:16,lvl:2727}],HideFlags:127,CanPlaceOn:["quartz_stairs"]}

Which gives us:
Diamond

Without the hideflags:
Without Flags

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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