Seeing that you were desperate for a true answer, I built a prototype (Still adding the torch item drop prevention, as the one I made broke due to the execute detect function being really buggy).
This prototype does what you want for the most part. It uses 3 scoreboard objectives: Jump, jumpCool, and Torch.
Jump is basic. If you jumped it sets jumpCool to 5 and then sets itself to 0.
jumpCool is the cooldown for when the light can be created. If you jumped it's set to 5, and if there is air below you it is set to 5.
Torch is set to 1 if you're holding a torch.
From the prototype some issues do occur, one being that for every block torch's can't be placed on, you need to add a command block to blacklist it.
Here's the prototype setup and commands: http://imgur.com/a/i9Yo2
The command block not talked about in the above link is the broken drop protection. Basic armor stand to block access to the torch, and then have a despawn timer for the armor stand and then delete the torch along with it. Still working on that so when it's done I'll note that it is.
Finished version:
Download: https://www.dropbox.com/s/dn9q5xak462rhq9/Creative%20Mode%2015w32.zip?dl=0
Assuming you have the "sentry gun" shooting arrows, you would use the command:
/summon Arrow x y z {damage:1,Motion:[x.0,y.0,z.0]}
You would have to plug into the first set of coordinates where you want the arrows to be shooting from, and the direction the arrows are shooting in the second. TIP: The higher the number you set for your direction (second set of coordinates, the faster the arrow will travel! You can set anything for the damage (except dont get too crazy :P)
As for your "Tool Box" Idea, you can do the test for command on a redstone ticker:
testfor @e[x,y,z,r,type=Item] {Item:{id:minecraft:iron_block}}
(Unfortunately, you cant test for a custom named block/entity - at least to my knowledge) Run a comparator out of this command block, to another command block (does not NEED to be a command block). This will start a fast ticking redstone clock on another command block. This command block will have the command:
testfor @e[x,y+1,z,r,type=Item] {Item:{id:minecraft: ... }}
Make sure that the coordinates you plug into the last testfor command have y+1 the y coordinate of the testfor command before that. This means it will test for the item on top of your "tool box". Run a comparator out of that command block to start the /summon Arrow command, or in other words, start up your sentry!
(The arrows are seen only as little black dots in this photo, but thats because I have the speed ramped up :)
Basically, its a system of Testing positive for an iron block at x y z - starting ticker to test for ... entity at x y+1 z - testing positive for ... entity at x y+1 z - starting ticker to shoot "sentry gun"
Hope this helps
Best Answer
Unlike the item variant for skulls, the metadata value for the skull block does not determine type, instead specifying directional facing. The
SkullType
tag determines the type of skull.Also unlike the item variant, the player information is not stored in a tag called
SkullOwner
. You'll want to useExtraType
instead, which transforms into the relevantOwner
compound (see here for a description of that format).