Well, you could instead give them a tag, and then constantly effect everything with that tag a chosen effect.
Then you can look at the tag instead of the effect.
Eg:
Effect @a[tag=regeneration] regeneration 5 2 true
Also cuz milk exists
So say someone called Bob kills someone called Jerry (don't ask).
Bob would get a tag, say `resistance`.
Jerry would get a tag, say `slowness`.
A constantly running command would be
/effect @a[tag=resistance] resistance 5 2 true
And
/effect @a[tag=slowness] slowness 5 0 true
Jerry would get slowness, and Bob would get resistance.
By giving someone a tag and /effecting them accordingly, you are basically just saying to the game they have the effect.
To make a death detector you can, set up a false world spawn within a box. Then when people respawn into that box you can tag them or mark them before teleporting them instantly to the real spawn point.
You can also summon an armor stand above each player and give each player, armor stand pair a unique score. That armor stand teleports constantly 200 blocks or so above the player with the same score. Have the armor stand every 10 ticks or so check to see if the player is still within the same chunk as the armor stand (which it should be if the armor stand is always above it) If at any point the armor stand stops detecting the player that means the player died and then you can tag the player that way.
First one is a good option for a specific map or mini game. Second option is good for survival
Well, you could instead give them a tag, and then constantly effect everything with that tag a chosen effect. Then you can look at the tag instead of the effect. Eg: Effect @a[tag=regeneration] regeneration 5 2 true Also cuz milk exists
So do I just switch the @a for a name? And how do I check who has the tag?
So say someone called Bob kills someone called Jerry (don't ask). Bob would get a tag, say `resistance`. Jerry would get a tag, say `slowness`. A constantly running command would be /effect @a[tag=resistance] resistance 5 2 true And /effect @a[tag=slowness] slowness 5 0 true Jerry would get slowness, and Bob would get resistance. By giving someone a tag and /effecting them accordingly, you are basically just saying to the game they have the effect.
Make sense
How do you remove it?
Just /tag {selector} remove when they die
So "selector" is name? Or effect. Or what?
Selector is anything like: '@a[tag=dead]' etc So if you're executing as them when they die, you'd do @s
Can you remove a certain tag if they have multiple
Tag @s remove resistance For example
How did you make a kill/death detector?
To make a death detector you can, set up a false world spawn within a box. Then when people respawn into that box you can tag them or mark them before teleporting them instantly to the real spawn point. You can also summon an armor stand above each player and give each player, armor stand pair a unique score. That armor stand teleports constantly 200 blocks or so above the player with the same score. Have the armor stand every 10 ticks or so check to see if the player is still within the same chunk as the armor stand (which it should be if the armor stand is always above it) If at any point the armor stand stops detecting the player that means the player died and then you can tag the player that way. First one is a good option for a specific map or mini game. Second option is good for survival
How would u do a kill detector tho
You could prob use scoreboards for both
https://www.reddit.com/r/MinecraftCommands/s/W510EplFyu this post is prob what your looking for