I thought of an idea where I could spawn in invisible Endermen and check if the player made the Enderman angry, but alas, there is no NBT Tag for the player that angered an enderman.
But that checks if a player is near the block, not if they're looking at the block.
You could be standing next to the block and looking the other way, or standing far away from the block and looking right at it.
All right, I figured out a way to do it.
When you look at an Enderman, it teleports away. Not instantly, but quick enough for the effect to work.
So I have this command:
testfor @e[X,Y,Z,1,type=Enderman]
I have that hooked up to a redstone torch to invert the signal. Then I have it hooked up to two command blocks:
summon Enderman X Y Z {//attributes to make it invisible and invulnerable, don't feel like typing them out.}
kill @p[X,Y,Z]
This assumes that the closest player to the block is the one who triggered the enderman, but at this point I'll take what I can get.
When you go into f3, look down to the last line on the left hand side while looking at a block. See how it says "Looking at: X Y Z", I was wondering if there is a way to detect that.
Is there a way to do this with command blocks?
Example:
I am an artist. All the art you see on my profile is by me, if it's not I will say so and whom its owner is.
You could be standing next to the block and looking the other way, or standing far away from the block and looking right at it.
When you look at an Enderman, it teleports away. Not instantly, but quick enough for the effect to work.
So I have this command:
I have that hooked up to a redstone torch to invert the signal. Then I have it hooked up to two command blocks:
This assumes that the closest player to the block is the one who triggered the enderman, but at this point I'll take what I can get.
When you go into f3, look down to the last line on the left hand side while looking at a block. See how it says "Looking at: X Y Z", I was wondering if there is a way to detect that.