I'm trying to make a sentry gun in minecraft, I've made the shooting system already (wich shoots at entities) but the problem is that the "sentry gun" works in an area around the main command block, I wanted to make a structure to work as the sentry instead of the main command block.
I've tried testing for an iron block named "Tool Box", I wanted to make something like placing the Tool Box and activating it using a dropped item on top of it or maybe even an item (I tried with a hoe for example) but I got no idea how to do it.
The Shooting System works like this:
It'll trigger at any entity that enters the area of the main command, except for players and arrows, when something enters the area it starts spawning arrows on d dtop of it that fall aneal damage, so basically I got the system working on a command, all I have to do is change so that command triggers at a certain structure.
Main command:
/execute @e[score_sentryKill_min=1,r=10] ~ ~2 ~ summon Arrow {damage:10.0}
Basically all other commands are "Don't target Players, don't target arrows, kill the arrows when they hit the ground"