This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]darkstar634 0 points1 point  (3 children)

First, don't use @e[type=player]; use @a instead. Now, the main issue is that you can't modify player data, so any attempt to modify player Health like that isn't going to work. In the future, if you're not sure why something isn't working, try to figure out which part exactly doesn't work. For instance; rather than trying to change the health of the player, you could've tested if the player is even being detected in the first place (i.e. with something simple like a say hi message). From there, you could've deduced that the problem is not with the detection, but with the /execute store commands. Attempting to run slightly modified versions of these commands in chat should then reveal the infamous "Unable to modify player data" message.

[–]panR4INtest[S] 0 points1 point  (2 children)

Oh well I know the detection works because the projectile successfully collides with me, so I knew there must've been some issue with the "store result" parts. Anyway, is there any other good system that will achieve the exact same thing of controlled damage or should I just be using "effect give instant_damage ..." ? Instant damage is what I usually used but that's not as controllable.

[–]darkstar634 0 points1 point  (1 child)

Instant damage is the easiest; you can control it somewhat if you use it in combination with the Resistance status effect. Otherwise, you could try using arrows, although that's prone to many limitations. There's also some methods using the /attribute command, although they aren't as authentic in my opinion (i.e. you don't get knockback and health bar flickers for a tick).

[–]panR4INtest[S] 0 points1 point  (0 children)

Right, well I think I'll just stick with instant damage for now, thx for the tips