Build a rotating glass prism in Minecraft that splits a pure white laser beam of stretched end-rod displays into seven diverging rainbow beams.
Machines & MechanismsHoly & LightTechnologyWhiteRainbowPurpleLearningDecorationMap MakingBlock displaysItem displaysArmor standsBlock building (fill/setblock/clone)Glowing outlinesRotation math21+ commands
This command creation sets up an optical physics display right in the middle of your world. An intense white laser made from stretched end_rod block displays fires from an emitter pedestal into a rotating crystal prism at the center of the stage.
When the beam hits the spinning glass prism, it refracts and splits into seven distinct rainbow rays made of glowing stained glass displays and color-matched dust particles. As the beams strike the floor, they ignite spinning color wheels and rising spark fountains that light up the night.
/scoreboard objectives add c9_tick dummy/fill ~-12 ~ ~-1 ~-10 ~ ~1 polished_blackstone_slab/setblock ~-11 ~ ~ sea_lantern/setblock ~-11 ~1 ~ beacon/fill ~-1 ~ ~-1 ~1 ~ ~1 quartz_slab/setblock ~ ~ ~ sea_lantern/summon block_display ~-10.5 ~1.5 ~ {Tags:["c9_all","c9_white"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:16777215,block_state:{Name:"minecraft:end_rod",Properties:{facing:"east"}},transformation:{translation:[0.0f,-0.15f,-0.15f],left_rotation:[0.0f,0.0f,0.0f,1.0f],scale:[10.5f,0.3f,0.3f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}/summon item_display ~ ~1.5 ~ {Tags:["c9_all","c9_prism"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:11197951,item:{id:"minecraft:tinted_glass",count:1},transformation:{translation:[0.0f,0.0f,0.0f],left_rotation:[0.0f,0.0f,0.0f,1.0f],scale:[1.8f,2.4f,1.8f],right_rotation:[0.0f,0.382f,0.0f,0.924f]}}/summon item_display ~ ~1.5 ~ {Tags:["c9_all","c9_prism"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:16777215,item:{id:"minecraft:amethyst_cluster",count:1},transformation:{translation:[0.0f,-0.2f,0.0f],left_rotation:[0.0f,0.0f,0.0f,1.0f],scale:[1.6f,2.0f,1.6f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}/summon armor_stand ~ ~1.5 ~ {Tags:["c9_all","c9_wheel"],Invisible:1b,NoGravity:1b,Marker:1b}/scoreboard players add #t c9_tick 1/execute as @e[tag=c9_prism] at @s run tp @s ~ ~ ~ ~4 ~/execute as @e[tag=c9_wheel] at @s run tp @s ~ ~ ~ ~12 ~/particle end_rod ~-5.2 ~1.5 ~ 2.5 0.05 0.05 0.01 3 force/particle flash ~ ~1.5 ~ 0.1 0.1 0.1 0 1 force/execute at @e[tag=c9_wheel] run particle end_rod ^ ^ ^1.3 0 0 0 0.02 2 force/execute if score #t c9_tick matches 1 run summon block_display ~ ~1.5 ~ {Tags:["c9_all","c9_beam"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:16720418,block_state:{Name:"minecraft:red_stained_glass"},transformation:{translation:[0.0f,-0.11f,-0.11f],left_rotation:[-0.012f,-0.228f,-0.051f,0.972f],scale:[11.0f,0.22f,0.22f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}/execute if score #t c9_tick matches 1 run summon block_display ~ ~1.5 ~ {Tags:["c9_all","c9_beam"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:16747520,block_state:{Name:"minecraft:orange_stained_glass"},transformation:{translation:[0.0f,-0.11f,-0.11f],left_rotation:[-0.008f,-0.153f,-0.052f,0.987f],scale:[10.4f,0.22f,0.22f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}/execute if score #t c9_tick matches 1 run summon block_display ~ ~1.5 ~ {Tags:["c9_all","c9_beam"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:16770560,block_state:{Name:"minecraft:yellow_stained_glass"},transformation:{translation:[0.0f,-0.11f,-0.11f],left_rotation:[-0.004f,-0.077f,-0.052f,0.996f],scale:[10.1f,0.22f,0.22f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}/execute if score #t c9_tick matches 1 run summon block_display ~ ~1.5 ~ {Tags:["c9_all","c9_beam"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:2293572,block_state:{Name:"minecraft:lime_stained_glass"},transformation:{translation:[0.0f,-0.11f,-0.11f],left_rotation:[0.0f,0.0f,-0.052f,0.999f],scale:[10.0f,0.22f,0.22f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}/execute if score #t c9_tick matches 1 run summon block_display ~ ~1.5 ~ {Tags:["c9_all","c9_beam"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:2284543,block_state:{Name:"minecraft:light_blue_stained_glass"},transformation:{translation:[0.0f,-0.11f,-0.11f],left_rotation:[0.004f,0.077f,-0.052f,0.996f],scale:[10.1f,0.22f,0.22f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}/execute if score #t c9_tick matches 1 run summon block_display ~ ~1.5 ~ {Tags:["c9_all","c9_beam"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:3364095,block_state:{Name:"minecraft:blue_stained_glass"},transformation:{translation:[0.0f,-0.11f,-0.11f],left_rotation:[0.008f,0.153f,-0.052f,0.987f],scale:[10.4f,0.22f,0.22f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}/execute if score #t c9_tick matches 1 run summon block_display ~ ~1.5 ~ {Tags:["c9_all","c9_beam"],brightness:{sky:15,block:15},Glowing:1b,glow_color_override:11149567,block_state:{Name:"minecraft:magenta_stained_glass"},transformation:{translation:[0.0f,-0.11f,-0.11f],left_rotation:[0.012f,0.228f,-0.051f,0.972f],scale:[11.0f,0.22f,0.22f],right_rotation:[0.0f,0.0f,0.0f,1.0f]}}/execute at @e[tag=c9_wheel] run particle dust{color:[1.0,0.15,0.15],scale:1.6} ~9.7 ~-1.35 ~-4.8 0.5 0.05 0.5 0 4 forcesetup #7 Summons a <code>block_display</code> using an east-facing <code>end_rod</code> stretched 10.5 blocks long on the X axis with <code>brightness</code> set to 15 and white <code>glow_color_override</code> to form the pure white incident laser beam.setup #8 Creates the outer shell of the optical prism at the center pedestal using a scaled, glowing <code>tinted_glass</code> item display offset by a 45-degree quaternion rotation.loop #2 Spins both layers of the central glass prism smoothly at 4 degrees per tick around the Y axis so the crystal facets catch the incoming beam.loop #7 On tick 1 of the loop, summons the seven refracted rainbow beams as stretched stained glass block displays rotated downward and fanned across the Z axis using quaternion <code>left_rotation</code> values and matching decimal RGB <code>glow_color_override</code>.


Recorded on our own test server: 47 frames at about 9.2 fps. Our image check saw: A beacon on a pedestal fires a white beam with spark particles into a rotating glass and amethyst prism, which splits the beam into seven glowing rainbow-colored rays.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To let a player aim or trigger the prism refraction with a handheld crystal, replace the fixed @e[tag=c9_prism] target with an armor stand teleported 2 blocks in front of @a[nbt={SelectedItem:{id:"minecraft:amethyst_shard"}}] so the beam splits wherever the player holds up the shard.
/kill @e[tag=c9_all]/fill ~-12 ~ ~-1 ~-10 ~1 ~1 air/fill ~-1 ~ ~-1 ~1 ~ ~1 air/scoreboard objectives remove c9_tickThe loop checks for score #t c9_tick matches 1 so the seven stretched block_display beams are created once and remain permanently active without causing entity lag.
Yes! Edit the first number in the scale array (currently between 10.0f and 11.0f) inside the block_display transformation NBT to make the rays longer or shorter.
▶Steampunk Astrolabe GyroscopeMachines & MechanismsMedium24 cmds
▶Steampunk Printing Press Newspaper RollMachines & MechanismsHard24 cmds
▶Victorian Phonograph Soundwave VisualizerMachines & MechanismsMedium24 cmds
▶Holographic Airport Air Traffic RadarMachines & MechanismsHard26 cmds
▶Holographic Deep-Sea Sonar Bathymetry SweepMachines & MechanismsHard24 cmds
▶Holographic DNA CRISPR SplicerMachines & MechanismsHard24 cmds