TransWikia.com

Is there a way to effectively prevent phantoms from spawning (1.14)?

Arqade Asked on November 3, 2021

The title may be vague (but I did that purposely to not make the question too confusing), but I’ll explain more specifics/details here.

First of all, I am looking for a method to not just get rid of phantoms, but effectively cease their spawning. I am aware that repeating command blocks and /gamerule doInsomnia (lets you toggle phantom spawning) exist, but I find repeating command blocks to get slightly laggy sometimes, and they also clog up my logs with messages of "unable to run" (basically spamming the logs with useless outputs), and I am playing on 1.14, meaning I do not have access to the phantom-toggle gamerule (I believe it was added in 1.15 19w36a).

Note that I am playing completely vanilla, and to ensure only working answers I’ll mention again that this question is only focusing on Java Edition, not bedrock or console.

To be more specific, I am playing version 1.14.4, if this line is needed.

Either a physical method (such as something like insomnia/bed manipulation or something like that) or actual commands would be fine, but if the only solution is through repeating command blocks that kill phantoms, then I will still take it as an answer.

While I do know that I might be able to make a slow redstone clock that periodically kills phantoms, I would prefer a physical solution.

(Side note: I have marked the question as "minecraft-commands", but if this tag does not fit or if the question is missing tags, then feel free to add them.)

3 Answers

Repeating /gamerule doInsomnia false becomes laggy.

Gamerules don't need to be repeated. You just set it once and that's that.

Also, one single repeating /gamerule doInsomnia false won't lag your server, unless you're running on severely underpowered hardware (and in that case, that's a whole different problem)

Basically: Just run /gamerule doInsomnia false ONCE and you're done.

Answered by aytimothy on November 3, 2021

Another solution is to set game difficulty to Peaceful, either in Settings or with the command /difficulty peaceful or /difficulty 0. According to the Minecraft Wiki article on Difficulty:

No hostile mobs can spawn naturally [in Peaceful mode], except for evokers ‌[Bedrock Edition only], vindicators ‌[Bedrock Edition only], shulkers, hoglins, zoglins, piglins, piglin brutes ‌[upcoming: BE 1.16.20], and the ender dragon. . . . When the difficulty is switched from any other setting to Peaceful, all mobs that are not allowed to spawn on Peaceful are removed from the world.

Since Phantoms are hostile mobs and not listed here as exceptions, they shouldn't be able to spawn naturally.

Of course, if you want to play in a non-Peaceful difficulty in Creative for some reason, you could always switch to Peaceful whenever a Phantom spawns to force it to be immediately removed from the world. However, this would obviously not achieve your stated goal of preventing Phantoms from spawning entirely.

Answered by Eliza Wilson on November 3, 2021

One solution is to keep it always day. Phantoms only spawn at night, according to the Minecraft Wiki article. Just toggle game rule doDaylightCycle to false while it is daytime. Note that this does come with the usual side effects of getting rid of the night.

And even if they do spawn, they are considered undead and will be set on fire in the sunlight.

Answered by ExpertCoder14 on November 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP