I want, so that when a player dies there is no items laying in the place of death and the player to lose his items, how do I do it?
Commentaires
qualityvote22025-12-30 15:05
* Upvote this comment if this is a good quality post that fits the purpose of r/Minecraft
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
First_Platypus30632025-12-30 15:06
Hardcore world is an option. Other than that, a mod
SquekPL2025-12-30 15:06
JAVA EDITION!
SquekPL2025-12-30 15:12
Idk how to kill only items without killing people because the only command that kills items is /kill @e that kills players too ( if there is a item specific command please tell me! ) but the curse of vanishing thing is actually smart!
el_yanuki2025-12-30 16:55
do you know this handy tool called google? Where you can type ["kill dropped items minecraft"](https://letmegooglethat.com/?q=kill+dropped+items+minecraft) and it will lead you to helpful websites?
DaTruPro752025-12-30 18:42
/kill @e [type=minecraft:item] I think.
Could be a bit wrong but I know it has to deal with the [type] parameter
Martitoad2025-12-31 11:06
The issue is that this deletes all items, not only the ones from death. Someone suggested keep inventory with scoreboard and clear to delete only the items from the inventory
DaTruPro752025-12-31 17:58
yeah, it isn't a solution to the OP's problem in the post, but he was asking how to kill all items without killing players
you are correct in that killing the dropped items doesn't work as a solution as Minecraft doesn't keep track of what items are dropped by players or not.
Clean-Inevitable68752025-12-30 20:01
/kill @ e\[type=item\]
without a space between the @ and e because it doesn't let me type them together
KredeMexiah2025-12-31 03:56
Escape the \@ just like you did the square brackets
Deebyddeebys2025-12-30 16:36
Keep inventory on
When player dies /clear them
Kecske_gamer2025-12-30 15:09
Apply curse of vanishing to everything.
Alternatively /kill items in a radius when a player dies
SquekPL2025-12-30 15:11
Idk how to kill only items without killing people because the only command that kills items is /kill @e that kills players too ( if there is a item specific command please tell me! ) but the curse of vanishing thing is actually smart!
-GottaGoFast-2025-12-30 15:14
/kill @e[type=item]
However, you would not know when to use it and there is a chance that the items are not loaded to be killed when you die.
SquekPL2025-12-30 15:15
Does it kill arrows? Like mid-air?
-GottaGoFast-2025-12-30 15:20
No, only dropped items. There's probably a smart way to do it with scoreboards, but I don't know how they work and I can't test at the moment.
Something like keep inventory on, setting up a scoreboard that tracks deaths, whenever it is 1 then clear the player, followed by setting the tracker back to 0.
You could ask in the Minecraft command subreddit, it's likely to get a better answer.
SquekPL2025-12-30 15:21
I asked chatgpt and it gave me some commands to do it Im gonna check if it works
-GottaGoFast-2025-12-30 15:26
Not a bad idea, if those don't work, I asked chatgpt, so maybe try these:
/scoreboard players set @a[scores={deaths=1..}] deaths 0
SquekPL2025-12-30 17:44
Why are people downvoting just because we asked chatgpt 😭
ThatsSaber2025-12-30 18:04
Fuck ai
leetsgeetweeird2025-12-30 18:11
Using AI makes you dumb (not saying you’re dumb, I’m saying it’s scientifically proven that the use of AI is making people less intelligent). The AI is not smart, it hallucinates constantly, and it’s also bad for the environment (uses a lot of water to run)
SquekPL2025-12-30 21:20
I rarely use AI, it was just this one time. When I use chatgpt it's mainly when I need help in the gaming world.
Purple-Mud50572025-12-30 18:37
In addition to the “fuck ai” already mentioned, you asked for a way to leave no items in the player’s inventory and their first suggestion was to turn keep inventory to True, because ChatGPT is a poor source of information. It gets it mixed up and ignores stuff all the time, and it pulls almost all of its information from stuff that can be directly accessed by the person who’s looking for it, and the person *should* be better able to discern whether they’ve found the right information or not. You never learn to do that though if you rely on AI for everything
razputinaquat02025-12-30 19:37
people are offering you good umbrellas from the rain and telling you where to find nice umbrellas and you are going with a tattered umbrella with holes
SquekPL2025-12-30 19:41
It explained everything, and nothing went wrong, I just don't see the problem
PotatoesAndChill2025-12-30 15:27
LLMs have never been reliable for anything but the most basic minecraft commands, but good luck
AnAverageTransGirl2025-12-30 16:25
That would be a projectile, not an item. It's a completely different kind of entity with a separate ID. That would be done with /kill @e[type=arrow]
SquekPL2025-12-30 17:31
I mean, it's good it doesn't kill projectiles
KiwiAAzz2025-12-30 15:39
So, if you can use command blocks you can do it like this:
(Do make sure to put this on the spawn chunks so the command blocks are always loaded)
1• Add an scoreboard objective to count deaths; Simply run this command once in your world: "/scoreboard objectives add Deaths deathCount"
This will detect when a player dies, then you must put two command blocks side by side pointing at the same direction (> >)
The first command block (the one that points into the other) will be the one doing the item erasing when the scoreboard objective updates
So
2• First Command Block;
You should click the buttons until they say this:
[Repeat] [Unconditional] [Always Active]
And then you should put this command inside:
"/execut at @a[scores={Deaths=1..}] run kill @e[type=item,distance=..5]"
The distance parameter is the block radius of the kill command, so it should only kill items on a 5 block radius around the player that died (you can increase it if you find that some items aren't erased)
3• The second command block;
It should be:
[Chain] [Unconditional] [Always Active]
And you should put this command inside:
"/scoreboard players reset @a[scores={Deaths=1..}] Deaths"
With that setup it should work as long as the command blocks are loaded; if you want to make sure they are you can stand atop of them and run this command: "/forceload add ~ ~" this should make it so the game never unloads them.
Alternatively, you could make it so the items are erased from their inventories on death so they don't even drop to begin with, the setup is the same (with the scoreboard and everything) except you add /gamerule keepInventory true and change the command of the first command block to this one:
"/execute clear @a[scores={Deaths=1..}]"
And that should do, I believe.
KapitanWalnut2025-12-30 17:53
Is spawn chunk loading still a thing? Wiki says [this feature](https://minecraft.wiki/w/Spawn_chunk) was removed in 1.21.9
KiwiAAzz2025-12-30 17:58
Oh damn seems like it was, had no idea, thanks for pointing that out
FourGander882025-12-30 20:18
Getting downvoted for this is insane
bali402025-12-31 00:36
Bro dared to ask a question and got voted to oblivion. Sadge
Tablondemadera2025-12-31 00:51
Don't do it like that, clear their inventory, don't /kill the items. That can lead to a lot of issues
SquekPL2025-12-30 15:17
Why are ppl downvoting 😭
PotatoesAndChill2025-12-30 15:28
Welcome to the sub. Now off to downvote hell you go!
SquekPL2025-12-30 16:02
NO PLEASE-
No_Yam_20362025-12-30 21:07
r/redditsniper
mjmannella2025-12-30 18:27
I imagine it's because people don't know why you want items permanently destroyed upon death
SquekPL2025-12-30 18:28
I don't want it because I'm making a little PvP, you choose your kit and go fight BUT if you kill someone you would be able to mix kits with the dead person, and that makes no sense
TheRealBingBing2025-12-30 18:48
If you're building like an arena, you could use mud and soul Sand, or any block that would work in a bunch of Hoppers so that way when they die the items get sucked into the Hoppers right away.
Edit: or you could do the same thing with a half slab floor. There's a small chance someone could rush and try to pick up the items but this is my cheat-free vanilla solution.
qwart222025-12-31 01:56
Holy lag
TheRealBingBing2025-12-31 01:57
Is there not less lag if they're covered? And how big of a PvP arena are you thinking it would lag out?
qwart222025-12-31 02:37
Hoppers cycle through each slot of the inventory above them but if there’s no slot it defaults to a decently high number, even a 10x10 would already be an insane amount of checks every second and 10x10 is probably not the size you want an arena unless you’re doing sumo
TheRealBingBing2025-12-31 02:38
Ahh thanks, I don't do PVP so I'm not familiar with how much space you need but I figured people build huge redstone things with lots of Hoppers and it doesn't seem too bad.
ThePMan20252025-12-30 19:26
That sounds cool
Specific_Tear6322025-12-30 15:27
Initial setup: use game rule `keep_inventory` so players don't drop items on death.
> `/gamerule keep_inventory true`
Make a scoreboard counter that tracks player deaths.
> `/scoreboard objectives add death deathCount`
Use a command block on repeat to detect player death and clear their inventory when it happens.
> `execute as @a[scores={death=1..}] run clear`
and reset the counter afterwards.
> `scoreboard players reset @a death`
Specific_Tear6322025-12-30 15:39
Note for future searches: tested in Java Edition 1.21.11
ShadyMan_2025-12-30 17:30
Ten years from now that number version will look odd
Journeyj0122025-12-30 17:37
Note for future searches: this is the version before 26.1
IndividualDish70042025-12-30 17:39
note for future searches: hi everyone from the future!!
DanakAin2025-12-30 17:57
Note for future searches: i also want to be in this thread
Lasdary2025-12-30 18:02
Note for future searches: Scooch over! i wanna be in the picture too
NoNoWahoo2025-12-30 18:12
Note for future searches: Please come back to 2025 and help us get out of the mess we put ourselves in, we'll give you $10,000 in whatever is valuable in your time
Pumpblench2025-12-30 18:18
Note for future searches: i hope minecraft isn't dead by the time you're reading this
Radiant_Tonight_12642025-12-30 18:32
I'm from the future; your comment is 13 minutes old. It isn't dead yet.
SquekPL2025-12-30 18:32
Note for future searches: it worked 🥲
MrCryngeYT2025-12-30 18:31
Note for future searches: In our time, this isn't little money. Of course, in the future, this is probably what a beggar makes in a day. Wait, some beggars do that nowadays already...
Dasselaxe2025-12-30 18:27
Note for future searches: I'm in the pic too
Virtual_Play_3742025-12-30 18:31
Note for future searchers: I to am in this episode
XyKal2025-12-30 19:10
note for future searches : I too, am in this thread
Commander_Crispy2025-12-30 20:36
This vexes me
spudmcloughlin2025-12-30 23:20
you are a black man
1Filip12025-12-31 09:34
Note for future searches : for those who come after
Niclipse2025-12-30 23:00
Then we shall be accidentally immortalized together for our moderate interest in this thread!
Also Hello people and robots from the future!
UniqueNobo2025-12-31 02:04
Note for future searches: this vexes me
TheChickenReborn2025-12-30 19:54
Note from future searching: Hi people in the past! Good news, we eventually get time machines that work with text! Bad news, well, you'll find out soon I guess.
BestialCreeper2025-12-30 22:51
note for future searches: i too am in this episode
King-Bob-56852025-12-30 23:23
note for future searches: this vexes me
lunarwolf20082025-12-30 22:06
yeah its way too short. im from the future. we have minecraft 5.4.33.79.29.2035. the next big update releasing on new years is 6.3.04.08.02.2036
TALON2_02025-12-30 17:32
Absolute legend
chameleonsEverywhere2025-12-30 17:45
You are a hero and a scholar for this
Bigby-Wolff2025-12-30 19:01
commenting to be a part of historical hellos crafter to crafter
stickansgrejer2025-12-30 19:37
Note for future researchers: Do you see all of us 2025 players as ’old’?
SnoweDragon992025-12-31 05:52
Back in my day oak wood was called wood and you had to pay for tools
undrscrsky2025-12-30 23:41
note for future searchers, hi guys 😝
el_yanuki2025-12-30 16:53
@p would be better i think .. for clearing the ec i couldnt think of a command, i think thats plugin-only
Regular_Ship20732025-12-30 17:19
Better for what?
el_yanuki2025-12-30 18:25
i have no clue, i guess i wasnt paying attention when writing that, makes no difference at all
StereoTunic90392025-12-30 18:00
Isn't @p the closest entity? What if someone is closer to the command block?
Edit: @p is the closest player, not entity (that's @n), the point still applies
Batesthemaster2025-12-30 21:26
I think thats @e
StereoTunic90392025-12-30 21:46
That's all entities
Spot_Responsible2025-12-30 17:41
What does the .. after the 1 do?
jzamoz2025-12-30 17:59
It counts any value that equals 1 or more. There is also the reverse, where having two periods before a number means anything equal or lower.
13ros272025-12-30 18:01
I don't know command syntax well enough to be sure but I would assume it is an unbounded range so it will apply for any death count 1 or above (often in programming ranges are written as `a..b` or `a..=b` for inclusive)
Luceo_Etzio2025-12-30 18:09
note: as spawn chunks are no longer a thing in Java Edition post-Copper Age, you'll likely want to forceload the chunk the command block is in with the `/forceload`command
I'm not all that familiar with Bedrock, but I believe the `/tickingarea` command is the correct equivalent
Sapphire-Catgirl2025-12-31 08:24
Ticking area is the correct command equivalent yes, but I’m not sure if the scoreboard command will work as I know scoreboard is slightly different on bedrock and that’s the one command family I haven’t really dabbled in too much so I can’t give a version that works on bedrock
PorteGoutte42025-12-31 13:38
You can also use these commands in a datapack using the tick function
tjinthetjicken2025-12-30 18:23
Wont this reset only one players inventory if they die at the same tome?
Specific_Tear6322025-12-30 18:34
It will apply to all players that have a non-zero `death` score at the time of the test.
tjinthetjicken2025-12-30 19:22
I'm stupid, thank you, I was just not reading
Snudget2025-12-30 18:37
I think you can even use item predicates in the clear command to keep some items (like armor, coins or whatever)
ShiroStories2025-12-30 19:18
I think it's possible to do it without the scoreboard, because of the NBT tag DeathTime, though I'm not sure what exactly it was called or if it still is in the game
asdf_cabbage2025-12-30 20:08
It's been a while since I last used commands so I may be remembering wrong, but wouldn't that /execute only work if the player that died has OP?
Specific_Tear6322025-12-30 20:53
Tested in Survival Mode with no cheats enabled. I believe command blocks and functions have their own permission level and `/execute` changes the location context, not the permission. Otherwise commands affecting mobs wouldn't work.
pkmn-alt2025-12-30 22:46
Would this reset everyone’s inventory when a player dies?
Doctursea2025-12-31 03:06
This is so great and it's only one more command than I already run in my server
dovahkiitten162025-12-31 04:03
Ooh, could this be used for clearing XP or looking for specific resources to loose (or making a list of items not to lose like tools)?
Wondering if this could be used for an inventory loss-lite, like dying has a punishment but you don’t lose everything.
MoonlitSapphire2025-12-31 04:26
W Comment bc of the additional info too, lol. Knew how to do that too, but it’s just so nice that it’s included anyways when it wasn’t even asked of, lol.
EandCheckmark2025-12-31 18:58
Pretty sure the `execute` command is unnecessary; just do `clear @a[scores={death=1..}]`.
Also, may want to add in a command that clears xp, too, depending on OP's needs.
OkAngle23532025-12-30 16:10
Just turn on/off keep inventory.
Edit: Are you wanting both the items to disappear from a players inventory upon death and the items itself to be yeeted out of the world? I am not understanding how you wrote the post.
\^If it is indeed this. I would personally TP the player down to the void when they reach 1 heart, they may complain; but... that is the most cleanest way to do this or you could have the items be cleared upon the players death.
AverageGamer26072025-12-30 16:32
I think they want items to just be insta-deleted upon death, rather than dropped on the ground
StubbsReddit2025-12-30 17:15
Bedrock edition has a free gravestone add on. All your stuff is stored where you die, you respawn with nothing except a note with updating instructions to find your death point and your stuff if you want it.
ravinggenius2025-12-30 17:16
Clear your inventory before dying.
First_Maintenance3262025-12-30 17:24
If this is for a trap you could include a dispenser to activate a flint and steel on the place of their death or something
Difficult-Mammoth4962025-12-30 17:48
OP wants the dead player's item gone when a player dies, just like in dead cells where you cant get your stuff back
SquekPL2025-12-30 18:04
PROBLEM SOLVED GUYS!
Emotional_Low_50222025-12-30 19:44
I'm invested, what was the solution?
SquekPL2025-12-30 19:48
/gamerule keepInventory true
On chat:
/scoreboard objectives add deaths deathCount
Repeating always active:
/execute as @a[scores={deaths=1..}] run clear @s
Chain conditional always active out of repeating:
/scoreboard players set @a[scores={deaths=1..}] deaths 0
poells2025-12-30 22:05
[deleted]
Alli_zon2025-12-30 23:57
I'm guessing as a command block
SquekPL2025-12-31 17:04
Yeah command blocks
Fixingsentries2025-12-30 18:52
I think there’s a mod where when you die, you leave behind a corpse that has all your stuff and you click on it to grab them
I always set KeepInventory to true. I don't have the time to waste recrafting the best tools in the game every time I die.
Trans_Cat_Girl_2025-12-30 21:57
Note for future searches: hi
EmilyBNotMyRealName2025-12-30 23:01
Depends on how far away you are from where you died. If you can run there before your stuff de-spawns do it. Just run in grab what you can and run out. If your to far away. Don't try there's no point.
Thetruestfan2025-12-31 00:29
You make them die with no items
ThooLoo4202025-12-31 01:50
repeating command block on always active mode.
type kill @e[type=item]
only issue is you won’t be able to drop or pickup items anymore.
you could maybe have this be a conditional command block after a command block testing for player deaths but i’m unfamiliar with how to test for that.
VVen0m2025-12-31 02:31
Set up a repeating command block with `/kill @e[type=minecraft:item]` in it
Ok_Trouble_94432025-12-31 03:26
Maybe you could set keep inventory on so the items aren't on the floor, and use command blocks to clear the players inventory when they die?
KenDemon2025-12-31 04:22
Put curse of vanishing on everything
SGT_Spoinkus2025-12-31 06:17
Kill them in lava?
Nighthopper082025-12-31 06:18
Lovely picture/description lol
Harun-JZ2025-12-31 12:08
what does "no items in ea" mean?
Dthlex2025-12-31 12:57
Grave data pack from this
Https://vanillatweaks.net/picker/datapacks/
avul_armenia2025-12-31 17:01
Bro who even deserves that type of torture 😭🙏
Deaths_Angel2192025-12-31 18:32
I honestly have no idea why this isn't a gamerule. It'd be fairly simple to implement.
Own-Phone-57192026-01-01 04:17
Just do /kill @e[type=items] it will kill all dropped items
Commentaires
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
Could be a bit wrong but I know it has to deal with the [type] parameter
you are correct in that killing the dropped items doesn't work as a solution as Minecraft doesn't keep track of what items are dropped by players or not.
without a space between the @ and e because it doesn't let me type them together
When player dies /clear them
Alternatively /kill items in a radius when a player dies
However, you would not know when to use it and there is a chance that the items are not loaded to be killed when you die.
Something like keep inventory on, setting up a scoreboard that tracks deaths, whenever it is 1 then clear the player, followed by setting the tracker back to 0.
You could ask in the Minecraft command subreddit, it's likely to get a better answer.
/gamerule keepInventory true
/scoreboard objectives add deaths deathCount
Repeating always active:
/execute as @a[scores={deaths=1..}] run clear @s
Chain conditional always active out of repeating:
/scoreboard players set @a[scores={deaths=1..}] deaths 0
(Do make sure to put this on the spawn chunks so the command blocks are always loaded)
1• Add an scoreboard objective to count deaths; Simply run this command once in your world: "/scoreboard objectives add Deaths deathCount"
This will detect when a player dies, then you must put two command blocks side by side pointing at the same direction (> >)
The first command block (the one that points into the other) will be the one doing the item erasing when the scoreboard objective updates
So
2• First Command Block;
You should click the buttons until they say this:
[Repeat] [Unconditional] [Always Active]
And then you should put this command inside:
"/execut at @a[scores={Deaths=1..}] run kill @e[type=item,distance=..5]"
The distance parameter is the block radius of the kill command, so it should only kill items on a 5 block radius around the player that died (you can increase it if you find that some items aren't erased)
3• The second command block;
It should be:
[Chain] [Unconditional] [Always Active]
And you should put this command inside:
"/scoreboard players reset @a[scores={Deaths=1..}] Deaths"
With that setup it should work as long as the command blocks are loaded; if you want to make sure they are you can stand atop of them and run this command: "/forceload add ~ ~" this should make it so the game never unloads them.
Alternatively, you could make it so the items are erased from their inventories on death so they don't even drop to begin with, the setup is the same (with the scoreboard and everything) except you add /gamerule keepInventory true and change the command of the first command block to this one:
"/execute clear @a[scores={Deaths=1..}]"
And that should do, I believe.
Edit: or you could do the same thing with a half slab floor. There's a small chance someone could rush and try to pick up the items but this is my cheat-free vanilla solution.
> `/gamerule keep_inventory true`
Make a scoreboard counter that tracks player deaths.
> `/scoreboard objectives add death deathCount`
Use a command block on repeat to detect player death and clear their inventory when it happens.
> `execute as @a[scores={death=1..}] run clear`
and reset the counter afterwards.
> `scoreboard players reset @a death`
Also Hello people and robots from the future!
Edit: @p is the closest player, not entity (that's @n), the point still applies
I'm not all that familiar with Bedrock, but I believe the `/tickingarea` command is the correct equivalent
Wondering if this could be used for an inventory loss-lite, like dying has a punishment but you don’t lose everything.
Also, may want to add in a command that clears xp, too, depending on OP's needs.
Edit: Are you wanting both the items to disappear from a players inventory upon death and the items itself to be yeeted out of the world? I am not understanding how you wrote the post.
\^If it is indeed this. I would personally TP the player down to the void when they reach 1 heart, they may complain; but... that is the most cleanest way to do this or you could have the items be cleared upon the players death.
/gamerule keepInventory true
On chat:
/scoreboard objectives add deaths deathCount
Repeating always active:
/execute as @a[scores={deaths=1..}] run clear @s
Chain conditional always active out of repeating:
/scoreboard players set @a[scores={deaths=1..}] deaths 0
https://minecraftcommands.github.io/wiki/questions/playerdeaths#run-a-command-when-the-player-respawns
type kill @e[type=item]
only issue is you won’t be able to drop or pickup items anymore.
you could maybe have this be a conditional command block after a command block testing for player deaths but i’m unfamiliar with how to test for that.
Https://vanillatweaks.net/picker/datapacks/