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
Rather than having a testforblock leading onto a fill command via a comparator, you can use the detect
function of execute
on a clock, which will allow the same bat that detects the air to execute the fill. E.G:
execute @e[type=Bat,score_Tree1_min=1] ~ ~ ~ detect ~ ~3 ~ air 0 fill ~-1 ~2 ~-1 ~1 ~8 ~1 air
Similar thing for spawning the dropped item:
execute @e[type=Bat,score_Tree1_min=1] ~ ~ ~ detect ~ ~3 ~ air 0 summon Item ~ ~2 ~ {Item:{Count:4,id:log,tag:{display:{Name:Wooden Log}}}}
Few sidenotes:
1. You can make the bat invulnerable and invisible like so:
/summon Bat X Y Z {NoAI:1,Silent:1,CustomName:"Tree1",Invulnerable:1b,ActiveEffects:[{Id:14,Amplifier:0,Duration:2147483647,ShowParticles:0b}]}
2. Players can use a nametag to name a bat "Tree1" themselves. Exploiting this, a player could destroy bedrock or clear large areas. Thus, you may want to set the Tree1 score based off of something other than the bat's name.
3. You'll probably want to kill the bat or set its score to 0 after it has been used, otherwise they'll accumulate and keep causing lag.
Best Answer
With
/setblock
, you specify a block's state right after its ID. You can see a block's states if you hover over it with F3 up:So, to make the dispenser face west:
If you are still on 1.10 or lower, you will instead need to use numeric data values, for which facing west is
4
: