-2

I'm trying to start a server that clears your inventory when spawning without pressure plates. Please help.

  • 3
    Shouldn't players spawn with empty inventories anyway? Do I misunderstand something? – user232393 Jun 28 '19 at 15:33
  • The only way to not have the player's inventory cleared would be to use /gamerule keepInventory – Roijan says reinstate Monica Jun 28 '19 at 15:40
1

You can use the command /clear [targets] [item] [maxCount], where:

  • targets is optional. It is the name of the player (or a target selector) whose inventory you wish to clear. If no player is specified, it will default to the player running the command.

  • item is optional. It is the item to clear (See list of Minecraft items). If no item is specified, then all items in the player's inventory will be cleared.

  • maxCount is optional. It is the maximum number of items that will be cleared. If you omit this parameter or use -1, all matching items will be cleared.

For your requirements, I suggest /clear @p, on a command block looping right bellow the player.

| improve this answer | |
0

the best way that I can think of is to make a command where every player except certain players have a repeat command the clears their inventory like this:

/clear @a[name=!NAME,name=!NAME,name=!NAME]

replace the extra name with names of players that you want their items to not be removed for example

/clear @a[name=!Steve,name=!NoobSlayer700,name=!Steve(1),name=!Dinnerbone]

this will clear all player inventories except Steve,NoobSlayer700,Steve(1) and Dinnerbone

| improve this answer | |
0

There are many ways to do this. First I need to know:

  • Do you want to make a PVP server or a freebuild server or something else?
  • In which cases do you want to clear the player's inventory?
  • Which version and console do you use?

What you can do is set the spawnpoint into a cube on bedrock, somewhere near to y=5 or so, and then clear the inventory of every player which is in the cube, and finally, teleport these players to the real spawn.

| improve this answer | |
-1

I only know of a method for computer and mobile.
On computer press T and type: /gamerule keepinventory false. The only thing is, on a Server, you might need to use command blocks. To do this use the command: /give (YOURUSERNAME) minecraft:command_block, enter the first command into the command block, and set the command block to always active from within the command Block and you should be good to go. On mobile: pause the game, go into settings, and then game. Scroll down until you see the word: Cheats. Scroll a little further until you see: Keep Inventory and toggle the switch right until it is to the right.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.