Minecraft – Errors in this Minecraft Disease code

minecraft-commandsminecraft-java-edition

I am trying to create a "disease" in minecraft. What I am doing is setting an entities score to 1 if they have the disease, then testing if they have that disease, if they do, it would set several other scores for the effects of the disease. Then I tried to make said disease contagious. If, say a zombie is infected by the disease, and I walk near it, it works perfectly fine and I get infected. What doesn't work is if said zombie walks past another mob, the other mob isn't infected. I can't figure out why. Here is the code:

/execute @e[score_Death_min=1] ~ ~ ~ /scoreboard players set@e[score_Death=0,r=3,c=100] Death 1

And here is the error message:

[12:11:58] Failed to execute '/scoreboard players set @e[score_Death=0,r=3,c=100] Death 1' as Test Subject

Best Answer

If that's actually the command you're using, there needs to be a space between the set and @e.

I'm not sure what your intending with the c argument. It shouldn't matter for the most part, but it seems useless and will only cause potential problems.

Make sure that the conditions are actually matched. Are the entities within 3 blocks? Is their "Death" score 0 (and not Null, which it starts as if not set to anything)?

The error message you are getting will happen even if the command is working as expected. After it sets the death score of nearby entities to 1, the command will fail because @e[score_Death=0,r=3,c=100] no longer targets anything. So make sure that it's this command that's actually the issue and not something else in your mechanism; this command could be working fine.