1

How to make a robot navigate throughout an area?(ArmorStand)

Wolfang5's Avatar Wolfang59/27/16 7:22 pm
1 emeralds 1.1k 24
11/1/2016 10:46 am
Pepijn's Avatar Pepijn
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.
Posted by Wolfang5's Avatar
Wolfang5
Level 1 : New Miner
0

Create an account or sign in to comment.

24

1
11/01/2016 10:46 am
Level 57 : Grandmaster Cyborg
Pepijn
Pepijn's Avatar
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] ....... ).
1
10/30/2016 10:42 am
Level 23 : Expert Engineer
Heklo
Heklo's Avatar
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.
1
09/28/2016 8:48 pm
Level 37 : Artisan Taco
SkySlasher20
SkySlasher20's Avatar
I'm not really sure. I think maybe you should widen your search a little bit and look for something other than vids
1
09/28/2016 8:25 pm
Level 39 : Artisan Fish
CHorse
CHorse's Avatar
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
09/28/2016 7:51 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
I did try so many test for blocks etc. but i'm just asking for more ideas.
1
09/28/2016 5:38 pm
Level 16 : Journeyman uwu
DoubleFelix
DoubleFelix's Avatar
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
09/28/2016 4:51 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
I don't want to install plugins I'm asking about command blocks
1
09/27/2016 11:35 pm
Level 6 : Apprentice Architect
minecraftboy3129
minecraftboy3129's Avatar
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
1
09/27/2016 11:30 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
I already did that but my queshton is how to make a armor stand move around WITHOUT other mobs.
1
09/27/2016 9:19 pm
Level 16 : Journeyman uwu
DoubleFelix
DoubleFelix's Avatar
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
1
09/27/2016 9:09 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
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
09/27/2016 9:05 pm
Level 39 : Artisan Fish
CHorse
CHorse's Avatar
Or you could pre-plan it. Basically lay out tiles 2 blocks below it telling it where to go.
1
09/27/2016 8:36 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
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
09/27/2016 8:31 pm
Level 39 : Artisan Fish
CHorse
CHorse's Avatar
Ye, put it on top of a silverfish or wolf and put either the player or sheep at the end.
1
09/27/2016 7:47 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
Anyone else have any ideas?
1
09/27/2016 7:36 pm
Level 16 : Journeyman uwu
DoubleFelix
DoubleFelix's Avatar
Sorry. Maybe try contacting other people here for more help.
1
09/27/2016 7:35 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
I googled it so many times and watched a bunch of youtube videos but thank you for trying to help.
1
09/27/2016 7:33 pm
Level 16 : Journeyman uwu
DoubleFelix
DoubleFelix's Avatar
Can you screenshot the command blocks and say what each one does? Maybe then I can help you
1
09/27/2016 7:31 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
I did that but it detects air in all directions
1
09/27/2016 7:30 pm
Level 16 : Journeyman uwu
DoubleFelix
DoubleFelix's Avatar
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
09/27/2016 7:29 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
I did look at that but I don't want to put cobblestone stairs underneath it
1
09/27/2016 7:28 pm
Level 16 : Journeyman uwu
DoubleFelix
DoubleFelix's Avatar
If that does not work I would check out Dragnoz's video: https://m.youtube.com/watch?v=a29A6F-M9yo
1
09/27/2016 7:27 pm
Level 1 : New Miner
Wolfang5
Wolfang5's Avatar
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
09/27/2016 7:26 pm
Level 16 : Journeyman uwu
DoubleFelix
DoubleFelix's Avatar
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
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome