Is there any way to disable PVP in Minecraft Java edition with a command, if I already have teams created that are needed?

Things I've Considered/Tried

  • Creating a team named all, giving it to everyone and turning off friendlyFire. This does not work for me because I already have teams that I use.
  • Changing the server properties. This does not work for me because I need to be able to change it from in-game. This is for a minigame I am making.

Thank you in advance!


1 Answer 1


You can use the weakness effect which when having a high strength does not allow the player to deal any damage. /effect give @a weakness 9999 255 true will give weakness 255 to all players until you clear it and also hide the bubbles to make sure they don't annoy anyone.

Note for Bedrock Edition players:

There is a gamerule command /gamerule pvp false which will disable PVP.

  • will that make it so the player can't do damage to mobs?
    – Millard
    Jan 5, 2022 at 6:43
  • The first command will also stop damage to mobs, the second will not.
    – Josh Hales
    Jan 5, 2022 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .