I need help summoning an entity in a radius of an entity, specifically a Wither Skull, since it could be used as a replacement entity.
I already know you need to use the double /execute command. I have already achieved this via the following command that spawns a lightning bolt around the player to hit another entity from a command block. The command is:
Put this on a redstone block, and it will strike any entities within a maximum radius of 8 and a minimum radius of 2 upon activation (I set this to pulse every 1 second). The issue here is that I'm trying to do the same thing so that if you throw, say, a snowball, where it lands marks the area lightning will strike. To do this, I need a marker and I thought a Wither Skull would suit. I used the following commands in order to try replicate a similar idea I did (in order of activation):
testfor @a[score_snowballthrown_min=1] - if this is successful, then the 2 commands will simultaneously activate: scoreboard players set @a[score_snowballthrown_min=1] snowballthrown 0 AND summon WitherSkull ~ ~1 ~ - following the summoning of the wither, I used a clock that repeats the command: tp @e[type=WitherSkull,c=1] @e[type=Snowball,c=-1] - and had another clock that pulses every 1 second to: execute @e[type=WitherSkull,c=1] ~ ~ ~ execute @e[rm=2,r=8] ~ ~ ~ summon LightningBolt
For some reason, it doesn't seems to work as the command doesn't seem to recognise that there is a Wither Skull somewhere or it struggled to locate it. It doesn't summon lightning bolts at near-by entities, even if I extend the difference between the radii. Is there any way so I can activate commands AROUND the Wither Skull?