1
So I made a robot (Armor Stand) and it can move follow you and much more but I just cant find out how to make it navigate by itself such as detect for blocks and if there is one then move another direction. Please help ive been trying so many times.
Create an account or sign in to comment.
24
1
I prefer using tags to "invert" a "signal" instead of a comparator + redstone_torch.
- scoreboard players tag @e[name=Robot] add block_1_0
- execute @e[name=Robot] ~ ~ ~ detect ~1 ~ ~ air 0 scoreboard players tag @e[r=0,name=Robot] remove block_1_0
After these 2 commands are ran, whenever the entity has the "block_1_0" tag it means it detected a block at ~1 ~ ~. Use separate tags for each direction (block_1_0, block_0_1, block_-1_0 and block_0_-1 for example.). You can test for tags using @e[tag=].
Keep in mind you can't stack multiple tag arguments into one selector (so @e[tag=a,tag=b,tag=c] doesn't work). Just stack executes to do this (so execute @e[tag=a] ~ ~ ~ execute @e[tag=b,r=0] ~ ~ ~ execute @e[tag=c,r=0] ....... ).
- scoreboard players tag @e[name=Robot] add block_1_0
- execute @e[name=Robot] ~ ~ ~ detect ~1 ~ ~ air 0 scoreboard players tag @e[r=0,name=Robot] remove block_1_0
After these 2 commands are ran, whenever the entity has the "block_1_0" tag it means it detected a block at ~1 ~ ~. Use separate tags for each direction (block_1_0, block_0_1, block_-1_0 and block_0_-1 for example.). You can test for tags using @e[tag=].
Keep in mind you can't stack multiple tag arguments into one selector (so @e[tag=a,tag=b,tag=c] doesn't work). Just stack executes to do this (so execute @e[tag=a] ~ ~ ~ execute @e[tag=b,r=0] ~ ~ ~ execute @e[tag=c,r=0] ....... ).
1
I doubt you would want to do this because of how complex of a topic it is, but if you feel so compelled here is what you would need to do:
This is a very confusing concept because you're trying to detect anything except for air in front of it, and especially considering the direction its facing. Instead, you would have to use a (and I hate to use this) comparator, attached to a redstone torch to negate it.
One command would test for air in front of the mob, and if its positive it will keep the redstone torch off. If there is no air in front of it (If there is a block in front of it) it will come out negative, and turn on the redstone torch, activating another command block which would change the direction of it.
This would require the use of either teleporting the armorstand or updating its motion tag.
Also, it would require at least 4 different tests, 1 for each direction.
The problem is it would test for blocks to the side of it (in the direction it isn't facing). This is why you would need to have a direction test as well, using the execute command to select the armorstand facing (for example) north, and force it to test for air 1 block north of it.
Edit:
You can use the conditional part of command blocks instead of comparators. I recommend looking up a tutorial on those because its hard to type it.
This is a very confusing concept because you're trying to detect anything except for air in front of it, and especially considering the direction its facing. Instead, you would have to use a (and I hate to use this) comparator, attached to a redstone torch to negate it.
One command would test for air in front of the mob, and if its positive it will keep the redstone torch off. If there is no air in front of it (If there is a block in front of it) it will come out negative, and turn on the redstone torch, activating another command block which would change the direction of it.
This would require the use of either teleporting the armorstand or updating its motion tag.
Also, it would require at least 4 different tests, 1 for each direction.
The problem is it would test for blocks to the side of it (in the direction it isn't facing). This is why you would need to have a direction test as well, using the execute command to select the armorstand facing (for example) north, and force it to test for air 1 block north of it.
Edit:
You can use the conditional part of command blocks instead of comparators. I recommend looking up a tutorial on those because its hard to type it.
1
I'm not really sure. I think maybe you should widen your search a little bit and look for something other than vids
1
Set up individual scenarios. Basically make a chain of command blocks for every combo of blocks the guy can find himself in. Much slower, much harder, but if ya don't want mobs then that's the only way I can think of.
1
I did try so many test for blocks etc. but i'm just asking for more ideas.
1
If you are going to do this you need are going to need a lot of setblocks, testforblocks, executes, comparators, tp, and a lot of AND gates. Good luck!
1
I don't want to install plugins I'm asking about command blocks
1
There might be a few plugins for that but i'm not sure.
I knew a NPC plugin but it stopped working for me
hope you figure this out
I knew a NPC plugin but it stopped working for me
hope you figure this out
1
I already did that but my queshton is how to make a armor stand move around WITHOUT other mobs.
1
Use a summon command to have an ArmorStand riding a wolf that is tamed
/summon Wolf ~ ~ ~ {Owner:"yourName",Passengers:{id:["ArmorStand"]}}
Hopefully that will work.
~Psy
/summon Wolf ~ ~ ~ {Owner:"yourName",Passengers:{id:["ArmorStand"]}}
Hopefully that will work.
~Psy
1
Someone already suggested that idea but I don't want to I want it to move around and find its way around through a mine
1
Or you could pre-plan it. Basically lay out tiles 2 blocks below it telling it where to go.
1
I want it to go mining and keep teleporting forward and finding its way around without any other mobs and btw I use a wolf to make it follow me so I already thought of that idea but thanks though.
1
Ye, put it on top of a silverfish or wolf and put either the player or sheep at the end.
1
Anyone else have any ideas?
1
Sorry. Maybe try contacting other people here for more help.
1
I googled it so many times and watched a bunch of youtube videos but thank you for trying to help.
1
Can you screenshot the command blocks and say what each one does? Maybe then I can help you
1
I did that but it detects air in all directions
1
You dont have to just change the coordinants in relative position to the armor stand and change the block to something such as cobblestone or grass
1
I did look at that but I don't want to put cobblestone stairs underneath it
1
If that does not work I would check out Dragnoz's video: https://m.youtube.com/watch?v=a29A6F-M9yo
1
I tried that but when it locates air in all directions it will try to move in all the directions and it will just do random things btw I use /execute @e[name=Robot1] ~ ~ ~ /testforblock air ~ ~1 ~-1 and I use a inverter signal and it always glitches out
1
You can use the /execute command to test if a block is near the armorstand. This is how I think it goes but IDK: /execute @e[name=test] ~ ~ ~ detect ~ ~ ~ cobblestone <data>
If there are any issues please correct this but I think it is right. ~Psy
If there are any issues please correct this but I think it is right. ~Psy