#Trying to keep inventory if a player is holding a specific item.

8 messages · Page 1 of 1 (latest)

rough blade
#

As said, I want to check on player death if a specific item is within the inventory. If so, remove that item and keep the rest of the inventory from dropping.

I know to use the event.entity.player.inventory.contains('item') within the EntityEvents.death and that I can use persistent data to set and cancel the EntityEvents.drops event. However I am not sure how to keep the inventory.

Is there an easier way to do this?

true foxBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

lucid barn
#

it's death + respawn event, not death + drop event

rough blade
lucid barn
#

no, it clears player's inventory

#

nothing to drop

rough blade
#

So am I storing the player's inventory in the persistend data, clearing it, then on respawn giving it back?