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?
2 Answers
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.
One way is to make him trigger 2 command blocks - one before the game starts Gamerule keepinventory true
and when he dies clear @p
Another way is to set gamemode to 2, (adventure mode) wHich make it not possible for players to drop anything, break any blocks, but only pvp. But again, its not possible to break any blocks. Hope it helped. :) (command on the command block: gamemode 2
)
-
1But 1) Players in adventure mode can still drop items. 2) Dying in adventure mode will still drop your inventory. Commented May 5, 2013 at 11:49