How Can I Keep EXP Levels, But Not Items?
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 do you keep experience in Minecraft?
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