1

Map help

SunsetBeauty 2/7/16 10:19 pm
371
2/12/2016 4:26 pm
I have a couple questions:

Can I testfor a mob in a certain radius of a block. (dirt,stone,etc)
And what's wrong with this command? It's not working for some reason
/execute @e[name=StickySituation] ~ ~ ~ /summon ArmorStand ~ ~ ~

pls help b0ss
Posted by
SunsetBeauty
Level 9 : Apprentice Explorer
7

  Have something to say?

JoinSign in

1

Heklo
02/12/2016 4:26 pm
Level 24 : Expert System
The first question, I'm not exactly sure what you mean. If you're talking about testing for entities in a radius of a specific coordinate that's easy. You would use this command:
/testfor @e[x=100,y=64,z=100,r=10]
This tests for an entity within 10 blocks of 100,64,100.

If you mean testing for a block type around the mob, not a specific coordinate, it gets a little more difficult. Here's what you can do:
/execute @e fill ~5 ~5 ~5 ~-5 ~-5 ~-5 sponge 0 replace dirt 0
/execute @e fill ~5 ~5 ~5 ~-5 ~-5 ~-5 dirt 0 replace sponge 0

These two commands force entities to replace all the dirt around them with a sponge block, i chose sponge because it is unnatural and won't interfere with other blocks. The first command replaces all dirt within a 5 radius of entities with sponge.
The second command changes the sponge back to dirt.
If the two are consequently ran on a circuit and activated at the same time, you can add a comparator onto one of them. This will send out a pulse whenever it replaces the dirt with sponge and than switches back.
In simpler terms: If an entity is within 5 blocks of dirt, the comparator will output a pulse of redstone. It should automatically reset itself as well.




As for the command that didn't work for you, it is the correct command. Make sure the entity is actually the correct name.


Let me know if you need further help.
1

Welcome