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:
Without the hideflags:
{ }
to your command whileCanPlaceOn:[]
belongs in the existing ones.