Updated:

Spawn phantoms game rule (spawn_phantoms)

The "Spawn phantoms" rule is called spawn_phantoms in Java 1.21.11 and later, and doInsomnia in 1.21.10 and earlier. Controls whether phantoms spawn near players who have not slept.

Basic data

NameSpawn phantoms
Rule name (Java 1.21.11+)spawn_phantoms
Old name (Java 1.21.10 and earlier)doInsomnia
Bedrock namedoinsomnia
Value typetrue / false
Defaulttrue

Commands you can copy

Turn off (false)

/gamerule spawn_phantoms false

Reset to the default (true)

/gamerule spawn_phantoms true

Check the current value

/gamerule spawn_phantoms

Java 1.21.10 and earlier

/gamerule doInsomnia false

Bedrock Edition

/gamerule doinsomnia false

Notes

Questions

Typing doInsomnia gives an error

In Java 1.21.11 and later the rule is called spawn_phantoms. Write /gamerule spawn_phantoms … instead. Worlds on 1.21.10 and earlier keep the old name.

How do I check the current value?

Run /gamerule spawn_phantoms without a value. The current value is shown in chat.

Other game rules