How to make a potion effect that infects another player when they die?

Started by Kito on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a potion effect that infects another player when they die?

I'm working on a mod that's a sort of infection, there's two effects, patient 0 and Infected. I wanna know if I can make the patient 0  effect take over someone with the infected effect?

(also first forum please forgive me if this isn't how you do it)

Joined Sep 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
id make a procedure that…
Mon, 06/01/2026 - 08:58

id make a procedure that triggers when a player dies and if they have the patient 0 effect get the nearest player with the infected effect and swap it out for patient 0

alternatively you could add a new attribute and when someone gets infected check for the highest value of that attribute present in any entity and give the new infected that +1 and then when the patient 0 dies you give the person with the lowest value in that attribute the patient 0 effect so it would be in chronological order 

Joined Jun 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I thought I sent this reply…
Thu, 06/04/2026 - 03:24

I thought I sent this reply a while ago but apparently not, but how I make it check for any entity? 

Joined Jun 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"Get nearest entity in…
Fri, 06/12/2026 - 12:14

"Get nearest entity in square cube" procedure block

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
And then just set the entity…
Fri, 06/12/2026 - 19:26

And then just set the entity to "living entity" in the procedure block to check for any mob, monster, or player.