When entity spawn using procedures, how do I give them the player’s armor?

Started by The Last Days … on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When entity spawn using procedures, how do I give them the player’s armor?

I’ve been trying to make a feature for my infection mod, specifically for when the player gets infected and dies. Using the “Spawn Entity” procedure, I haven’t been able to give the resulting mob the same helmet or hold items of the player from before they died. Is there any way to make this possible? I would take any suggestion besides maybe coding since it’s a small part of a much larger procedure, but anything is better than nothing.

Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use 4 itemstack global…
Wed, 10/29/2025 - 06:27

Use 4 itemstack global variables that are persistent to the world call them infected_head/chest/legs/boots, then when the player dies with that effect make each variable equal to the armor in each slot, then when that mob spawns set each armor slot to each variable, and if you want it to be a one off, then make then equal to air after that.