Build a glowing quartz and gold shrine with a floating celestial orb that locks onto swooping phantoms and strikes them down with beams of light.
Eclipses & Celestial EventsHoly & LightMysticRoyalWhiteGoldDecorationAdventure MapMap MakingItem displaysSummoned mobsBlock building (fill/setblock/clone)Status effectsRotation math21+ commands
Phantoms can ruin any peaceful night build, but this Heavenly Phantom Defense shrine clears the skies with style. A glowing quartz and gold altar sits at the center of your base with a floating celestial orb spinning gently above it.
Whenever a phantom swoops too close, the orb locks onto the monster, marks it with a golden aura, and calls down a pillar of celestial particles to destroy it before it can attack.
/scoreboard objectives add c9_t dummy/fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 quartz_bricks/fill ~-1 ~ ~-1 ~1 ~ ~1 chiseled_quartz_block/setblock ~ ~1 ~ gold_block/setblock ~ ~2 ~ beacon/setblock ~-2 ~ ~-2 sea_lantern/setblock ~2 ~ ~-2 sea_lantern/setblock ~-2 ~ ~2 sea_lantern/setblock ~2 ~ ~2 sea_lantern/summon item_display ~ ~4.5 ~ {Tags:["c9_core"],Glowing:1b,glow_color_override:16766720,item:{id:"minecraft:end_crystal"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.3f,1.3f,1.3f],translation:[0f,0f,0f]}}/scoreboard players add #t c9_t 1/execute if score #t c9_t matches 80.. run scoreboard players set #t c9_t 0/execute as @e[tag=c9_core] at @s run tp @s ~ ~ ~ ~6 ~/execute at @e[tag=c9_core] run particle dust{color:[1.0,0.85,0.2],scale:1.4} ~ ~ ~ 0.6 0.6 0.6 0 5 force/execute at @e[tag=c9_core] run particle end_rod ~ ~-1 ~ 0.3 0.5 0.3 0.02 2 force/execute if score #t c9_t matches 5 run summon phantom ~6 ~7 ~-5 {Tags:["c9_ph"],Size:2}/execute if score #t c9_t matches 30 run summon phantom ~-6 ~8 ~4 {Tags:["c9_ph"],Size:2}/execute if score #t c9_t matches 55 run summon phantom ~5 ~7 ~6 {Tags:["c9_ph"],Size:2}/execute as @e[type=phantom,tag=c9_ph] at @s run tp @s ~ ~-0.06 ~ ~4 ~/execute as @e[type=phantom,tag=c9_ph] at @s run scoreboard players add @s c9_t 1/execute as @e[type=phantom,tag=c9_ph,scores={c9_t=10..30}] at @s run effect give @s glowing 2 0 true/execute at @e[type=phantom,tag=c9_ph,scores={c9_t=10..30}] run particle dust{color:[1.0,0.9,0.3],scale:2.0} ~ ~0.5 ~ 0.5 0.5 0.5 0 10 force/execute at @e[type=phantom,tag=c9_ph,scores={c9_t=31}] run particle end_rod ~ ~ ~ 0.4 7 0.4 0.03 200 force/execute as @e[type=phantom,tag=c9_ph,scores={c9_t=32..}] at @s run damage @s 100 minecraft:magicsetup #10 Summons an enlarged glowing <code>item_display</code> showing an End Crystal above the beacon to act as the spinning celestial defense orb.loop #3 Rotates the celestial orb 6 degrees every tick while keeping it floating in place above the shrine.loop #11 Applies the glowing effect to phantoms that have been tracked by the shrine for at least half a second, showing that the orb has locked onto them.loop #13 Unleashes a tall vertical pillar of <code>end_rod</code> particles right through the targeted phantom right before dealing lethal magic damage.


Recorded on our own test server: 45 frames at about 9.0 fps. Our image check saw: A quartz and gold altar with a floating golden orb marks incoming phantoms with a glowing aura and strikes them down with vertical pillars of white particles.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To use this as a real survival defense turret instead of a self-running demo, remove loop commands 6, 7, 8, and 9 (which summon and move the demo phantoms). Then replace tag=c9_ph in the remaining loop commands with distance=..24 so the shrine locks onto any natural phantom that flies within 24 blocks of the orb.
/kill @e[tag=c9_core]/kill @e[tag=c9_ph]/scoreboard objectives remove c9_t/fill ~-2 ~ ~-2 ~2 ~2 ~2 air/fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 grass_blockNo, the targeting selector explicitly filters for <code>type=phantom</code>, so players, villagers, and pets are completely safe around the beam.
Yes, when using the player version selector, change <code>distance=..24</code> to a larger radius like <code>distance=..40</code> to protect a wider base.
/damage/effect/execute/fill/particle/scoreboard/setblock/summon/tp
▶The Watching Sky TitanEclipses & Celestial EventsHard23 cmds
▶Celestial Hourglass Sandstorm InversionEclipses & Celestial EventsHard24 cmds
▶Time Acceleration PhenomenonEclipses & Celestial EventsEasy24 cmds
▶Celestial Time-Lapse OrreryEclipses & Celestial EventsMedium24 cmds
▶Cosmic Time AccelerationEclipses & Celestial EventsHard23 cmds
▶Sundog Halo Ice Crystal SkyEclipses & Celestial EventsHard24 cmds