This is just a follow-up question from my previous one, Specific lightning arrow task, after the arrow strikes, and only using a specific bow. So in that one, I asked how would one summon lightning an x amount of times, at an arrow, after it hits the ground. Thanks to mindoverflow, I now know how to do it.
I'm going to write all the code here, because we will need this in a moment.
Stating all the variables needed:
/scoreboard objectives add UseBow minecraft.used:bow
/scoreboard objectives add Strike dummy
/scoreboard objectives add Timer dummy
Command block that gives the special bow:
give @p bow{CustomModelData:103,display:{Name:"[{\"text\":\"Asraelax’s\",\"color\":\"yellow\"},{\"text\":\" Chaos\",\"color\":\"yellow\"}]",Lore:["{\"text\":\"Curse of Zeus\",\"color\":\"gray\",\"italic\":false}"]},Unbreakable:1,HideFlags:7}
First separate chain:
[Repeat] execute at @a[scores={UseBow=1..},nbt={SelectedItem:{id:"minecraft:bow",Count:1b,tag:{CustomModelData:103,display:{Name:"[{\"text\":\"Asraelax’s\",\"color\":\"yellow\"},{\"text\":\" Chaos\",\"color\":\"yellow\"}]"}}}}] run data merge entity @e[type=arrow,limit=1,sort=nearest,distance=..2] {Tags:["lightningarrow"]}
[Chain] execute as @a[scores={UseBow=1..}] at @e[type=arrow,tag=lightningarrow,nbt={inGround:1b},limit=1] run summon minecraft:armor_stand ~ ~ ~ {Tags:["lightning"],Invulnerable:1b,Invisible:1b}
[Chain] execute at @e[tag=lightningarrow,nbt={inGround:1b}] run scoreboard players remove @a UseBow 1
[Chain] kill @e[tag=lightningarrow,nbt={inGround:1b}]
Second separate chain:
[Repeat] scoreboard players add @e[tag=lightning] Timer 1
[Chain] execute as @e[tag=lightning,scores={Timer=1}] at @s run summon minecraft:lightning_bolt
[Chain] execute as @e[tag=lightning,scores={Timer=1}] at @s run scoreboard players add @s Strike 1
[Chain] execute as @e[tag=lightning,scores={Timer=5}] at @s run scoreboard players set @s Timer 0
[Chain] kill @e[tag=lightning,scores={Strike=5}]
So this works perfectly, to change the number of lightning strikes, we only have to change the number in
kill @e[tag=lightning,scores={Strike=5}]
However, after being Zeus for an hour, I became pretty bored, and I thought, what else can I summon? A falling block of course. Now, to become Gaia, I can just change what to summon and state where to summon it (~ ~10 ~)
right? Well, technically, that's correct, but it will only summon a column of sand, not really spread out.
So here's my problem, I want to summon a bunch of falling blocks, that is a 3 x 4 x 4. (Basically, a rectangular prism, height 3, width & length 4, that is all sand), 10 blocks on top of an arrow shot from a specific bow.
You can just say, well, make 12 of the second separate chains, and you'll be done, right?
Yep, that's true, but for that you need 24 variables, which is pretty boring and no one wants to write that much code. Two requirements, 1, in must have a less amount of chains and variables. 2. It must be flexible, say, I want to increase the x by 10 and y by -5, I can just change 2 variables, and done, not like destroying command blocks and having to paste them in again.
This is very much appreciated if you solve this problem, I might put a bounty on this later if this doesn't get answers.
P.S. I'm not using /setblock
or /fill
because I might want to replace the falling block with another block.
/summon ~ ~ ~ falling_block
(My command syntax is rusty.)