Keep an item on death

Started by Coolkc456 on Fri, 07/23/2021 - 18:22

Topic category: Help with modding (Java Edition)

Last seen on 21:51, 26. Aug 2021
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Keep an item on death
Fri, 07/23/2021 - 18:22

I don't want a specific item dropping on the ground when the player dies and having it stay in the player's inventory. Does anyone know how to do this? Thanks in advance.

Last seen on 09:08, 18. Sep 2021
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I would try saving the item…
Fri, 07/23/2021 - 18:50

I would try saving the item as a variable (itemstack). When the player dies, the item is saved, and when he respawns, it's loaded / given to him.