I'm trying to build an "adventure map" and a way to finish off a survival server that I have been running with some friends, but I've run into a problem.
I'm trying to attach the CanPlaceOn tag to redstone blocks so they can only be placed on stained glass panes the same color as the sector it was retrieved from, but I can't figure out how to specify the extension number (14=red, 1=orange, etc.)
How do I do this?
Hi awalton3! Thanks for getting in touch.
We actually ran into this same problem in the Forest Temple in Ocarina of Time, where 4 redstone torches are designed to be placed on four different wool colours. Unfortunately this is currently impossible to do in Minecraft, so a work-around will have to be found. We ended up placing barrier blocks on the incorrect blocks and removing those barrier blocks one by one, since the torches had to be lit in a pre-set order.
If you have access to a resource pack with your map, it is possible to retexture a block to look exactly the same but with a separate block id; that said, transparent blocks are hard to come by so this would only work in a couple cases.
If this isn't possible for you, then one possibility I came up with quickly was a repeating command block to check if the player is holding the correct redstone block which then removes the barrier block temporarily. You can do this by checking the Lore tag of an item in the nearest player's selected item slot. Unfortunately, if the game is multiplayer this technique can be abused.
Finally, you could ask the player to throw the item (with q) onto the correct area and your game checks the Lore value of the floating item, and if it is correct then triggers the system to activate, setting the block, removing the item, and activating whatever redstone needs activating. I think this is the easiest solution, and actually doesn't require the CanPlaceOn tag at all!
If this doesn't help, feel free to let us know. Duskreaper may have more elegant workarounds!