I've got this map with a few cities in it, and I'd like to switch over all the traffic lights to something made with command blocks. I'd have yellow blocks with item frames on them, and use entitydata commands to change what colour of stained clay they hold. However, I suck with command blocks and can't for the life of me figure out how to specify which item frames are to be changed. I have other item frames in the world so I can't do something like 'All frames facing north or south'. It'd be nice if I could have something to look at a relative spot within a radius so I can just build it once and copy/paste them under each intersection, but if I have to type up coordinates for each signal, I will. Thank you in advance!
search up a command for invisible and named armorstands and place them over the lights you want to trigger at the same time, create a command block saying execute @e[type=ArmorStand] ~ ~-1 ~ blockdata...
add: make the command have execute @e[type=ArmorStand,name=Name Here] ~ ~-1 ~ blockdata...
You could use the /clone command to change the light. If you don't want to specify commands for each create a system under each intersection that clones and object with the ~ ~ ~ to give it the coords relative to the command block then you can just clone that where you need it.
So I use the invisible armour stands as a reference point for where the traffic lights are, and have a command executed at the stand's position to change the item frame within a small radius of it? And with it being by name, would that mean I can control all the traffic lights in my map from a single command block clock rig, or would I need to make a few to account for the fact that redstone doesn't work when it's too far?
I looked up on this, and apparently if I leave the controller around the spawn point, it'll stay loaded and functional? I'll start toying around with this this evening to see if I can get it working.
Ok, I got it to make it so I got a command of 'change all item frames in a radius of 4 to be stone' to happen at every armor stand. But now, I can't figure out how to name armor stands. I went right up to a stand and put in '/entitydata @e[r=2] {CustomName:E/W}', and set the command block's command to 'execute @e[type=ArmorStand, name=E/W] ~ ~ ~ entitydata @e[r=4] {Item:{id:minecraft:stone,Count:1,Damage:0}}', but that didn't work. I don't think I did it right. Is there a way to get an armor stand in my inventory that's already named and invisible for me to plop down?
Ok, I got it to make it so I got a command of 'change all item frames in a radius of 4 to be stone' to happen at every armor stand. But now, I can't figure out how to name armor stands. I went right up to a stand and put in '/entitydata @e[r=2] {CustomName:E/W}', and set the command block's command to 'execute @e[type=ArmorStand, name=E/W] ~ ~ ~ entitydata @e[r=4] {Item:{id:minecraft:stone,Count:1,Damage:0}}', but that didn't work. I don't think I did it right. Is there a way to get an armor stand in my inventory that's already named and invisible for me to plop down?
There are a multitude of characters that cannot be used in target selectors. This includes spaces and slashes. You need to change the name to something usable in the selector, as well as removing all spaces.
Alrighty, there we go! It works. Just made the names be NS and EW, without the slashes. Now, the way it is right now, I'm going to have to swing through placing all the armor stands, copy paste the command '/entitydata @e[r=2] {CustomName:EW}', then go through again for the NS ones, and AGAIN with '/entitydata @e[r=2] {Invisible:1}'. I guess I can do that, but can I put armor stands in my inventory that already have these attributes? Or at the very least put the naming and the invisible-ing into one command?
Alrighty, there we go! It works. Just made the names be NS and EW, without the slashes. Now, the way it is right now, I'm going to have to swing through placing all the armor stands, copy paste the command '/entitydata @e[r=2] {CustomName:EW}', then go through again for the NS ones, and AGAIN with '/entitydata @e[r=2] {Invisible:1}'. I guess I can do that, but can I put armor stands in my inventory that already have these attributes? Or at the very least put the naming and the invisible-ing into one command?
You separate tags with a comma:
/entitydata @e[r=2] {CustomName:"EW",Invisible:1}
Unfortunately there is currently no way to have a set of predetermined tags for item variants of entities to apply to the entity when placed (such as paintings, item frames, armor stands, and spawn eggs).
I love the way you made your things, however, I was wondering, wouldn't it be much more compact and spaced efficient if you added a command block clock? Such as when it reaches a certain "time" of a fake player it will put a signal to put maybe a block real quick and then remove it, just a suggestion to make it a bit compact but other than that, it is amazing! (You ran past a yellow light by the way)
add: make the command have execute @e[type=ArmorStand,name=Name Here] ~ ~-1 ~ blockdata...
Call Of Duty Map: http://www.minecraftforum.net/forums/mapping-and-modding/maps/2260622-call-of-duty-multiplayer-1-1-2-12-players
Drifting Map: http://www.minecraftforum.net/forums/mapping-and-modding/maps/2327789-drifting-1-8-establish-a-new-colony-in-space-50
Block Defenders Map: http://www.minecraftforum.net/forums/mapping-and-modding/maps/2344825-block-defenders-v-1-1-8
I looked up on this, and apparently if I leave the controller around the spawn point, it'll stay loaded and functional? I'll start toying around with this this evening to see if I can get it working.
Call Of Duty Map: http://www.minecraftforum.net/forums/mapping-and-modding/maps/2260622-call-of-duty-multiplayer-1-1-2-12-players
Drifting Map: http://www.minecraftforum.net/forums/mapping-and-modding/maps/2327789-drifting-1-8-establish-a-new-colony-in-space-50
Block Defenders Map: http://www.minecraftforum.net/forums/mapping-and-modding/maps/2344825-block-defenders-v-1-1-8
There are a multitude of characters that cannot be used in target selectors. This includes spaces and slashes. You need to change the name to something usable in the selector, as well as removing all spaces.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
You separate tags with a comma:
Unfortunately there is currently no way to have a set of predetermined tags for item variants of entities to apply to the entity when placed (such as paintings, item frames, armor stands, and spawn eggs).
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
I love the way you made your things, however, I was wondering, wouldn't it be much more compact and spaced efficient if you added a command block clock? Such as when it reaches a certain "time" of a fake player it will put a signal to put maybe a block real quick and then remove it, just a suggestion to make it a bit compact but other than that, it is amazing! (You ran past a yellow light by the way)