Prismatic Light Refraction Prism Experiment

Build a rotating glass prism in Minecraft that splits a pure white laser beam of stretched end-rod displays into seven diverging rainbow beams.

Java EditionHolograms & Display EntitiesMedium24 commandsTested on a real 26.2 & 26.3 server
A white laser beam hits a glass prism and splits into seven glowing rainbow rays at night. Download the GIF Video & GIF © www.9minecraft.net

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.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_tick dummy
  2. /fill ~-12 ~ ~-1 ~-10 ~ ~1 polished_blackstone_slab
  3. /setblock ~-11 ~ ~ sea_lantern
  4. /setblock ~-11 ~1 ~ beacon
  5. /fill ~-1 ~ ~-1 ~1 ~ ~1 quartz_slab
  6. /setblock ~ ~ ~ sea_lantern
  7. /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]}}
  8. /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]}}
  9. /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]}}
  10. /summon armor_stand ~ ~1.5 ~ {Tags:["c9_all","c9_wheel"],Invisible:1b,NoGravity:1b,Marker:1b}

2. Loop - one repeating command block each (Always Active) 14 commands

  1. /scoreboard players add #t c9_tick 1
  2. /execute as @e[tag=c9_prism] at @s run tp @s ~ ~ ~ ~4 ~
  3. /execute as @e[tag=c9_wheel] at @s run tp @s ~ ~ ~ ~12 ~
  4. /particle end_rod ~-5.2 ~1.5 ~ 2.5 0.05 0.05 0.01 3 force
  5. /particle flash ~ ~1.5 ~ 0.1 0.1 0.1 0 1 force
  6. /execute at @e[tag=c9_wheel] run particle end_rod ^ ^ ^1.3 0 0 0 0.02 2 force
  7. /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]}}
  8. /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]}}
  9. /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]}}
  10. /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]}}
  11. /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]}}
  12. /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]}}
  13. /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]}}
  14. /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 force

How it works

Frames from the test run

Prismatic Light Refraction Prism Experiment - frame 1Prismatic Light Refraction Prism Experiment - frame 2Prismatic Light Refraction Prism Experiment - frame 3

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.

Build it in your world

  1. Find a flat open area at least 25x25 blocks wide and stand at the exact center block.
  2. Run each command from the Setup list in chat in order to build the laser emitter, the prism pedestal, the white laser beam, and the central rotating crystal.
  3. Place 14 Repeating Command Blocks set to Always Active near your stage.
  4. Paste the 14 Loop commands into the repeating command blocks (using execute positioned at your stage center if the command blocks are placed off to the side).
  5. Set the time to night (<code>/time set midnight</code>) so the glowing laser beams, flash particles, and stained glass rays stand out against the dark sky.

Use it with real players

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.

Remove it again 4 commands

  1. /kill @e[tag=c9_all]
  2. /fill ~-12 ~ ~-1 ~-10 ~1 ~1 air
  3. /fill ~-1 ~ ~-1 ~1 ~ ~1 air
  4. /scoreboard objectives remove c9_tick

FAQ

Why do the rainbow beams only summon once instead of every tick?

The 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.

Can I change the length or angle of the refracted rainbow rays?

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.

Commands used

/execute/fill/particle/scoreboard/setblock/summon/tp

Similar creations

Join 9Minecraft News & Guides