I’m trying to make a damaging snowball command which doesn’t need redstone (comparators, repeaters etc.) This is the entire code:
Command one:
/scoreboard players set xXElite_PythonXx HoldSnowball 1 {SelectedItemSlot:0,Inventory:[{tag:{display:{Name:"shuriken",Lore:["_____"]}}}]}
Command two:
/execute @e[score_HoldSnowball_min=1] ~ ~ ~ scoreboard players set @e[type=Snowball,rm=3,r=4] Snowball 1
Command three:
/execute @e[type=Snowball,score_Snowball_min=1] ~ ~ ~ effect @e[r=2] wither 1 1 true
Command four:
/scoreboard players set xXElite_PythonXx HoldSnowball 0
Command two is crucial in order for the whole damaging schematic to work, but the problem is that it doesn’t execute the command, it instead says:
[15:55:42] Failed to execute ‘scoreboard players set @e[type=Snowball,rm=3,r=4] Snowball 1’ as xXElite_PythonXx
Could you please help to fix the problem with command number two? What is the correct code?
Answer
I found out that if you put this command into a repeating command block, it should work:
/execute @e[type=Snowball] ~ ~ ~ effect @e[type=!Player,r=2] minecraft:instant_damage 1 1
You can alter the damage amplifier by changing the second 1 after instant damage higher. Unfortunately, this will not effect zombies. If you wish to give instant damage to all entities except yourself, I would use:
/execute @e[type=Snowball] ~ ~ ~ effect @e[rm=1,r=2] minecraft:instant_damage 1 1
If you just want to target zombies use:
/execute @e[type=Snowball] ~ ~ ~ effect @e[type=Zombie,r=2] minecraft:instant_health
Make sure to type:
/gamerule commandBlockOutput false
I hope that this has helped, I tried to make it as simple as possible. Have fun with this command!
Attribution
Source : Link , Question Author : guest , Answer Author : Skylinerw