Minecraft – players in pvp not dropping items in minecraft

minecraft-java-edition

I am trying to create a map where a mob class is chosen, the player fights, dies and respawns to fight some more as a different class. I dont want him to keep his inventory, and I dont want other players to pick up his items. What can I do to make the dropped items completely dissappear?

Best Answer

Depending on how the died player respawn...

If the player "respawns" at a specific place, you may set gamerule keepinventory true, set the player's spawn point to a pressure plate connecting to a bunch of command blocks, one is clear @p to clear the player's inventory, then another one is tp @p <x> <y> <z>. Since you mentioned "class", I think that would be something like SethBling's Super Craft Bros: Brawl map and that you can refer to it. Of course, since some more commands (e.g. scoreboard) are added in 1.5, you may use them to make things less complicated.

Check the following video Super Craft Bros: Brawl Developer Commentary by SethBling:

For some more information on commands and command blocks, you can check the Minecraft Wiki.

Since the information and requirements you provided is limited, I can't comment more.