Guide · Configuration

How to turn PvP on or off

How you control PvP depends on your version. Older servers use a line in server.properties, while 1.21.9 and newer use a game rule. Plugins add the finer control most communities want, such as safe spawns and arenas.

Minecraft 1.21.9 and newer

PvP is a game rule. Run gamerule pvp false in the console on 1.21.9 and 1.21.10. From 1.21.11, including all 26.x versions, the rule is called minecraft:pvp, so run gamerule minecraft:pvp false. It applies immediately, needs no restart and is saved with the world. Type the start of the command and use tab completion to see the exact name your version uses.

Minecraft 1.21.8 and older

Set pvp=false in server.properties and restart the server. This applies to every world on the server.

PvP in some areas only

Most servers want PvP off at spawn and on in an arena or the wilderness. WorldGuard does this with regions: select the area with WorldEdit, define a region, and set its pvp flag to deny or allow. The __global__ region controls the default for each world.

  • /rg define spawn
  • /rg flag spawn pvp deny
  • /rg flag arena pvp allow

Letting players choose

On an SMP, per-player PvP toggle plugins let each player opt in or out, usually with a cooldown so nobody switches mid-fight. Land-claim plugins such as GriefPrevention can also protect players inside their claims.

StormNodes Minecraft hosting

Run it on a StormNodes server

Skip the port forwarding and the PC that has to stay on. A StormNodes Minecraft server is online in minutes, and everything in this guide can be done from the panel.

  • Hosted in Portugal, close to players across Western Europe
  • NVMe storage, monthly billing and no setup fee
  • Paper, Purpur, Fabric and vanilla, switchable from the panel
  • Live console, file manager, SFTP, backups and schedules
  • Support in English and Portuguese

FAQ

Frequently asked questions

Why is there no pvp line in my server.properties?
Minecraft 1.21.9 moved PvP to a game rule. Use the gamerule command instead.
Does turning PvP off stop all player damage?
It stops direct player attacks and most projectiles. Indirect damage such as lava, TNT or pushing players off cliffs can still happen, which is why protection plugins exist.
Can I have PvP in the Nether only?
Yes. Game rules are per world, and Paper servers keep the Nether as a separate world, so you can set the rule differently there. WorldGuard's global region per world is the other option.