Version 1.13
I'm creating a spell book, and have two self heal spells that are working fine, but I'm hitting a wall trying to make a group heal.
The working spell Heal 1 is a stack of six command blocks, always active, first on repeat, all others on chain. I have a scoreboard trigger for spellHeal1
, and a spell book that activates the trigger when a player clicks the spell name. This is all working currently.
Command blocks:
1: execute as @a[level=1..,scores={spellHeal1=1}] run scoreboard players set @s spellHeal1 2
2: scoreboard players set @a[scores={spellHeal1=1}] spellHeal1 0
3: xp add @a[scores={spellHeal1=2}] -7 points
4: effect give @a[scores={spellHeal1=2}] minecraft:instant_health
5: scoreboard players set @a[scores={spellHeal1=2}] spellHeal1 0
6: scoreboard players enable @a spellHeal1
For the group heal, blocks 1-3 will still work for identifying the player casting the spell, resetting it for anyone that didn't have enough XP, and subtracting XP for successful casters. Blocks 5 and 6 will work for resetting the spell trigger for everyone every cycle.
I need to replace block 4 with something that will give the effect to all players within a 10 block radius of the players with spellHeal1=2
(i.e. the casters). I'm thinking it'll be something along the lines of creating an invisible entity at player location, or maybe a falling_block, and then giving the effect within a radius of that, but I'm hitting a mental block here. I've never used either of those things, just played with them a bit following tutorials. I haven't fully wrapped my head around properly implementing them.
Any ideas?
execute at @a[bla] as @a[distance=..10]
?