Build an automated floating laser emitter in Minecraft Java using commands that shoots a glowing beam to carve a scorching pattern into the ground.
Trails & PathsTechnologyFireIndustrialRedOrangeBlackDecorationCinematicMap MakingParticlesBlock displaysScoreboard timersExecute chainsBlock building (fill/setblock/clone)Glowing outlinesRotation math21+ commands
Watch a high-tech floating beacon hover above a stone slate and fire a concentrated red laser beam onto the surface below. As the cutting point glides along a square path, it scorches the stone into glowing magma and dark deepslate while throwing up bright sparks, lava droplets, and heavy smoke.
This command creation uses a moving target entity and a raycasting step entity to draw a solid line of dust particles between the overhead emitter and the moving ground point every tick.
/scoreboard objectives add c9_t dummy/fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 polished_andesite/fill ~-6 ~-1 ~-6 ~6 ~-1 ~-6 polished_deepslate/fill ~-6 ~-1 ~6 ~6 ~-1 ~6 polished_deepslate/fill ~-6 ~-1 ~-5 ~-6 ~-1 ~5 polished_deepslate/fill ~6 ~-1 ~-5 ~6 ~-1 ~5 polished_deepslate/summon block_display ~ ~6 ~ {Tags:["c9_las","c9_em"],Glowing:1b,block_state:{Name:"minecraft:beacon"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1.2f,1.2f,1.2f],translation:[-0.6f,-0.6f,-0.6f]}}/summon marker ~-4 ~ ~-4 {Tags:["c9_las","c9_tar"]}/summon marker ~ ~6 ~ {Tags:["c9_las","c9_ray"]}/scoreboard players add #t c9_t 1/execute if score #t c9_t matches 160.. run scoreboard players set #t c9_t 0/execute if score #t c9_t matches 0 run fill ~-4 ~-1 ~-4 ~4 ~-1 ~4 polished_andesite/execute if score #t c9_t matches 0 run tp @e[tag=c9_tar] ~-4 ~ ~-4/execute if score #t c9_t matches 1..40 as @e[tag=c9_tar] at @s run tp @s ~0.2 ~ ~/execute if score #t c9_t matches 41..80 as @e[tag=c9_tar] at @s run tp @s ~ ~ ~0.2/execute if score #t c9_t matches 81..120 as @e[tag=c9_tar] at @s run tp @s ~-0.2 ~ ~/execute if score #t c9_t matches 121..159 as @e[tag=c9_tar] at @s run tp @s ~ ~ ~-0.2/execute as @e[tag=c9_ray] at @e[tag=c9_em] facing entity @e[tag=c9_tar,limit=1] feet run tp @s ~ ~ ~ ~ ~/execute as @e[tag=c9_ray] at @s run tp @s ^ ^ ^0.95/execute at @e[tag=c9_ray] run particle dust{color:[1.0,0.1,0.1],scale:1.4} ~ ~ ~ 0.05 0.05 0.05 0 4 force/execute as @e[tag=c9_ray] at @s facing entity @e[tag=c9_tar,limit=1] feet run tp @s ^ ^ ^0.95/execute at @e[tag=c9_ray] run particle dust{color:[1.0,0.4,0.1],scale:1.2} ~ ~ ~ 0.05 0.05 0.05 0 4 force/execute at @e[tag=c9_tar] run setblock ~ ~-1 ~ magma_blocksetup #7 Summons a glowing <code>block_display</code> showing a beacon block centered six blocks above the stage to act as the floating laser nozzle.loop #5 During the first 40 ticks of the 160-tick cycle, the target marker slides 0.2 blocks per tick along the X axis. The following three commands slide it along the remaining sides of the square.loop #9 Teleports the ray marker back to the overhead emitter and rotates it to face directly toward the moving target marker on the floor.loop #10 Steps the ray marker forward along its line of sight using local coordinates (<code>^ ^ ^0.95</code>) so particles can be spawned along the beam path.loop #14 Replaces the stone block directly underneath the laser target with a glowing <code>magma_block</code> to leave a molten engraved trail.


Recorded on our own test server: 60 frames at about 9.9 fps. Our image check saw: A floating beacon hovers above a stone platform as a square path of magma blocks forms below, though the red laser beam only reaches a short distance beneath the beacon.
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 the engraving laser manually, remove loop commands 1 through 7 and replace them with /execute at @p anchored eyes run tp @e[tag=c9_tar,limit=1] ^ ^ ^5 so the laser target follows where you look.
/kill @e[tag=c9_las]/scoreboard objectives remove c9_t/fill ~-6 ~-1 ~-6 ~6 ~-1 ~6 grass_blockYes. Change magma_block at the end of the final loop command to any block you like, such as gilded_blackstone, crying_obsidian, or sea_lantern.
Edit the RGB values inside dust{color:[1.0,0.1,0.1],scale:1.4} in the loop commands. For example, use [0.1,0.8,1.0] for a cyan plasma laser.
▶Automated Laser Mining RigTrails & PathsMedium24 cmds
▶Orbital Particle Excavation BeamTrails & PathsMedium23 cmds
▶Aerodynamic Wind TunnelTrails & PathsMedium22 cmds
▶Autonomous Sweeping Beam TurretTrails & PathsMedium24 cmds
▶Burning Powder Fuse TrailTrails & PathsEasy23 cmds
▶High-Voltage Arc BarrierTrails & PathsMedium24 cmds