The idea being: I want items to "despawn" only when the player dies
Sounds easy enough by giving all items an Age value of -32768 to keep them from despawning, counting deaths using scoreboards and killing all items whenever the player dies, the problem is on multiplayer, if I do that, whenever someone dies on the server, every item will be deleted and I want only the items of the player who died to be deleted
I am currently not targeting specific items but I rather set all items' age to that value or delete them all by using @e[type=Item] selector on an always active repeating command block, not sure if it's even possible to give each different player a unique way to identify them and have the same identification system on the items in order to later be able to target items dropped only by them in order to kill them, or is there a way?
EDIT: Almost forgot to say I'm using Java edition 1.12.2
This sounds like something doable with NBT tags if you are only wanting certain items to despawn. You can also name islands and then run a kill @e[name=name]
On a side note I think if you post this in the Java commands section you might have more luck.
If you can detect people dying /scoreboard I would run an execute command that triggers once and kills all the items in that area.
Something like /execute @e[type=player] ~~~ kill @e[type=item,r=15]
The trick is making this only cast when they die which is something I feel you can achieve in Java.
Problem is, that would kill the items instantly, I want to kill only the previously dropped items by the same player that died and leave the items dropped in the current death, yet it seems it's still impossible as I've been trying for some time, researching on this, will have to settle for something else I guess
Couldnt you spawn in a armor stand to the spot when you die. And then on the next death it kills the items around armor stand that armor stand and then deletes it.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
The idea being: I want items to "despawn" only when the player dies
Sounds easy enough by giving all items an Age value of -32768 to keep them from despawning, counting deaths using scoreboards and killing all items whenever the player dies, the problem is on multiplayer, if I do that, whenever someone dies on the server, every item will be deleted and I want only the items of the player who died to be deleted
I am currently not targeting specific items but I rather set all items' age to that value or delete them all by using @e[type=Item] selector on an always active repeating command block, not sure if it's even possible to give each different player a unique way to identify them and have the same identification system on the items in order to later be able to target items dropped only by them in order to kill them, or is there a way?
EDIT: Almost forgot to say I'm using Java edition 1.12.2
EPIC :E
This sounds like something doable with NBT tags if you are only wanting certain items to despawn. You can also name islands and then run a kill @e[name=name]
On a side note I think if you post this in the Java commands section you might have more luck.
If you can detect people dying /scoreboard I would run an execute command that triggers once and kills all the items in that area.
Something like /execute @e[type=player] ~~~ kill @e[type=item,r=15]
The trick is making this only cast when they die which is something I feel you can achieve in Java.
Problem is, that would kill the items instantly, I want to kill only the previously dropped items by the same player that died and leave the items dropped in the current death, yet it seems it's still impossible as I've been trying for some time, researching on this, will have to settle for something else I guess
Thanks for the help anyways
EPIC :E
Couldnt you spawn in a armor stand to the spot when you die. And then on the next death it kills the items around armor stand that armor stand and then deletes it.