Captured items after a player dies?

Started by Darned on

Topic category: Help with modding (Java Edition)

Last seen on 18:35, 9. Jun 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Captured items after a player dies?

How can you make, for example, a sword that does not drop out after the player has died so that this item remains in the inventory after it is revived?

Use persistent player…
Thu, 06/10/2021 - 07:11

Use persistent player variable to flag if player had specific item in inventory when it died and then use global triggers to add them back

Last seen on 05:05, 19. Apr 2024
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Uhh I have a similar problem…
Tue, 01/30/2024 - 08:30

Uhh I have a similar problem. A player while using my custom item becomes its owner, and the item remembers who owns it so no one else could use it. The problem is, when the owner dies, items he owned should return to their normal state like before. To solve this, I tried storing a player persistent variable to link for owned items, and clear their data if the owner dies, but it seems that an item-type variable actually does not link, but stores a copy instead.