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
| Name | Spawn phantoms |
|---|---|
| Rule name (Java 1.21.11+) | spawn_phantoms |
| Old name (Java 1.21.10 and earlier) | doInsomnia |
| Bedrock name | doinsomnia |
| Value type | true / false |
| Default | true |
Commands you can copy
Turn off (false)
/gamerule spawn_phantoms falseReset to the default (true)
/gamerule spawn_phantoms trueCheck the current value
/gamerule spawn_phantomsJava 1.21.10 and earlier
/gamerule doInsomnia falseBedrock Edition
/gamerule doinsomnia falseNotes
- Java 1.21.11 renamed game rules to lower case with underscores. If an older command or a map description uses the old name, rewrite it for your version.
- Game rules are saved per world. On a server, a new world starts with the default values again.
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.