How Can I Keep EXP Levels, But Not Items?

How Can I Keep EXP Levels, But Not Items? - A Person Buying From a Grocery

As of 1.10 You can keep your items with /gamerule keepinventory true. A lot of people say remove EXP, and keep items. However, my goal is to keep EXP, but lose items. Is this at all possible? If it takes a plugin, tell me which one. I can't use mods, as this world is a server. Thanks for noticing!



Best Answer

Yes. instead of killing a player, you can just clear the items from his inverntory:

/clear [player] [item] [data] [maxCount] [dataTag]

The attributes in brackets are optional. In order to clear every player's inventory, use this:

/clear @a

And to delete 5 dirt blocks from the nearest player's invetory, use this:

/clear @p dirt 5

For more information on how to use the /clear command, visit the Minecraft Wiki

If you want also to teleport the players to spawn, just kill them with /kill @a (assuming you already have done /gamerule keepInventory true)




Pictures about "How Can I Keep EXP Levels, But Not Items?"

How Can I Keep EXP Levels, But Not Items? - Table with coffee machine near trash can in modern workspace
How Can I Keep EXP Levels, But Not Items? - Person in White T-shirt Holding Cake
How Can I Keep EXP Levels, But Not Items? - Silver Fork on White Round Plate



How do you keep experience in Minecraft?

  • Open the chat window in your game.
  • Type \u201c/gamerule keepInventory true\u201d in the chatbox.
  • Press \u201cEnter.\u201d
  • After you die, you'll still have all your tools.
  • Click on \u201cRespawn\u201d to restart the game.




  • Filtering XP and Unstackable Items




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Julia Avamotive, Dayvison de Oliveira Silva, SHVETS production, alleksana