Updated:
1. Permanent night vision
/effect give @s night_vision infinite 0 true
infinite needs Java 1.19.4+; the final true hides particles. On Bedrock use:
/effect @s night_vision 99999 0 true
Short durations make the screen flicker in the last ten seconds.
2. Everyone
/effect give @a night_vision infinite 0 true
Players who join later do not get it, so a repeating command block can keep applying it.
3. Always day
/time set day
/gamerule advance_time false
Use doDaylightCycle on 1.21.10 and earlier, and dodaylightcycle on Bedrock. See the time command.
4. Invisible light blocks (Java)
/give @p light 64
Light blocks are only visible while you hold one. They light builds without torches and stop mob spawns. Right click to change the level from 0 to 15.
5. Clear night vision or darkness
/effect clear @s night_vision
/effect clear @s darkness
The dark pulses near a warden are the darkness effect, which comes back while it is nearby.
6. Night vision potion
/give @p potion[potion_contents={potion:"minecraft:long_night_vision"}]
An 8 minute potion (Java 1.20.5+). On Bedrock use /give @p potion 1 6.
Troubleshooting
- infinite fails: use a number of seconds on Bedrock or before Java 1.19.4.
- Dark underwater: see the underwater commands.
- Gamma: brightness settings cannot be changed by command.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.