1

I'm making a hotel and a room key system, I'm trying to make the keys only be able to be placed on certain types of wool.

Example of what I'm doing:

/give @p minecraft:lever 1 0 {CanPlaceOn:["minecraft:wool"]}

I want the wool to have data like when in a /give command. The second number is the data example:

/give @p wool 1 5
1
  • 1
    So you want to only be able to place your lever on the certain wool 1 5? – Jason_ Mar 27 '16 at 0:20
-1

Actually, this is not possible (yet), even in 1.9. The bug is posted here. (For some reason, it says Resolved, but it's not).

When eventually they fix it, it should look something like this (also simplified your command a bit):

/give @p lever 1 0 {CanPlaceOn:["wool 1"]}

Replace 1 with whatever the ID of the wool you want. Here are the IDs of each colored wool.

1
  • 3
    It's resolved as invalid because it's a feature request, not a bug. It only supports an ID, no Damage values, which is just a lack of a feature and not a bug. When it does come to support them, Damage values will no longer exist because BlockStates will be used instead (such that only IDs exist, and the ID for blue wool would be akin to minecraft:wool[color=blue] or even minecraft:blue_wool if mapped in that manner). See also this comment by Grum. – Skylinerw Mar 27 '16 at 2:23

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