I am trying to fix it so that if you have a badge (Boulder Badge for example), when you walk up to a gate, it automagically opens and the badge is taken away from you. The gate should only open if you have that badge in your inventory. If you don't you get no reaction at all from the gate.
I am doing this via command blocks as it seemed like it required the least amount of work to maintain it once set up.
What I have:
I have a timed clock mechanism to get a constant pulse for it to be checking for players to walk up to a spot.
If the first Command Block sees a player, it then sends a signal to the second command block to remove boulder badge from player and open door.
----
Thats the dream at least.
What actually usually happens is the first one functions perfectly, the second command block then removes the badge and opens the door. Cool.
I then try the process again and notice that the comparator (or whatever) is still on. I have to remove the second commandblock to get it to turn off. I also notice that even when I dont have a boulder badge in my inventory, I could still open the door..
What I guess I need is some sort of /testfor and it look for an item but I am not aware of that testfor command existing.. yet..
Does anyone know of a better way? Does anyone know of a plugin that adds commands to commandblocks?
Help?
Edit:
The exact commands from both blocks:
First one (The one closest to the pulsating clock) testfor @p[r=3,x=1830,y=102,z=-1755]
Second one: clear @p[r=3,x=1830,y=102,z=-1755] 4212
Where 4212 is my Boulder Badge id.