#Keep Inventories from Before and After Entity Transformation?

1 messages · Page 1 of 1 (latest)

dawn void
#

There are no ticking areas, I can't use them for reasons beyond my control.

I've got this entity with a death animation and a chest for inventory. When you kill it, it turns into a special death entity, plays its animation, and then I remove it. But before it vanishes, I need to drop its original inventory from before it transformed.

I thought about temporarily saving the inventory in a database in case a player leaves mid-animation.
But now, I'm leaning towards a simpler solution: using let inventory = getContainer(entity) in my code.

This way, I can just fetch the inventory as needed during each death animation. Even if two entities die simultaneously and share an inventory, it's no big deal for me. This method should keep the item data safe without extra storage. I wish I could store the entity before and after transformation, but that's not something that exist yet from the looks of it in the API.

Wanted to see if anybody else had some thoughts on this.

lofty portal