I've run into a headache setting up a Minecraft server (using the FTB modpack). Having set up a sweet open air spawn-jail and moved the spawn point into it (using MCedit), I started hitting things as a non-op and noticed that the default spawn protection of 16 blocks radius worked fine for inside the house but wasn't enough to keep people from messing up the lawn, so I set it to 42 blocks in the server.properties file.

Now spawn-protection seems to be entirely disabled for non-op players, which I thought wasn't possible! Changing it back to spawn-protection=16 doesn't restore spawn protection either. Why isn't spawn-protection working on my server?


Details and proactively answering likely questions:

  • The spawn protection was absolutely working before I messed with the server.properties file.
  • I have restarted the server every time I've changed the file.
  • I have tried breaking blocks both with an account that was opped + Creative Mode before but deopped + Survival Mode to test, as well as with another account that was never opped or switched from Survival.
  • The spawn point is legal according to MCedit.
  • Running Feed The Beast BETA Modpack A v12 (which means Minecraft 1.4.2)
  • The spawn jail looks like this (the spawn point is in the middle of the third floor, which is the top row of windows):

    a picture of the floating spawn jail just to give context

  • My server.properties file:

    #Minecraft server properties
    #Wed Dec 19 12:39:24 PST 2012
    generator-settings=
    allow-nether=true
    level-name=FTB-Beta-A
    enable-query=false
    allow-flight=false
    server-port=25565
    level-type=DEFAULT
    enable-rcon=false
    level-seed=
    server-ip=
    max-build-height=256
    spawn-npcs=true
    white-list=false
    spawn-animals=true
    snooper-enabled=true
    hardcore=false
    texture-pack=
    online-mode=true
    pvp=false
    difficulty=3
    gamemode=0
    max-players=25
    spawn-monsters=true
    generate-structures=true
    view-distance=10
    spawn-protection=16
    motd=Minecraft With Friends
    

Solved it!

A meandering discussion on the Talk page for the server.properties article on the Minecraft Wiki indicates that this is Forge's fault. Apparently it redefines spawn-protection to be a boolean that turns protection on or off entirely (which you can't do in vanilla), and defines a new variable, spawn-protection-size for what the former variable means for a vanilla server.

As a side effect, it appears that a server with the Forge API installed will honour the default spawn-protection area of 16 blocks until you edit the variable, at which point it treats it as boolean and looks for spawn-protection-size instead, doesn't find it, and effectively turns spawn protection off entirely.

So this is what happened to me then. Adding spawn-protection-size=42 to my server.properties file made spawn protection work (again) as expected. Redefining configuration variables is poor practice!