203: Raycast experiments with command blocks. [Minecraft Map Making]
Ep203: Seeing if we can make a reasonable raycasting system using command blocks.
Java Version: 1.19
Commands, builds and ideas for people making their own Minecraft maps.
Check out my collabs on Coppit's channel: https://www.youtube.com/c/CoppitJ
Join the CoppitCraft server that I play on and the Discord where I hang out.
Server IP: 51.81.246.145:25588
Discord: https://discord.gg/amU84KykEu
The following commands are prefixed with three letters which represent the settings of the command block. E.g IUN: = Impulse Unconditional Needs_Redstone. These prefixes need to be removed if copying the commands.
Commands used:
Setup:
IUN: scoreboard objectives add raycast used:carrot_on_a_stick
Initialize ray:
RUA: execute as @a[scores={raycast=1..}] at @s positioned ~ ~1.5 ~ run summon area_effect_cloud ~ ~ ~ {Tags:["ray"], Radius:0f, Duration:20}
CUA: execute as @a[scores={raycast=1..}] at @s positioned ~ ~1.5 ~ rotated as @s run tp @e[tag=ray,distance=0..0.5] ~ ~ ~ ~ ~
CUA: scoreboard players reset @a raycast
Move Ray:
RUA: execute as @e[tag=ray] at @s if block ~ ~ ~ air run tp ^ ^ ^0.3
Message on hit:
RUA: execute as @e[tag=ray] at @s unless block ~ ~ ~ air store success entity @s Duration int 0 run tellraw @a {"text":"hit"}
Setblock on hit:
RUA: execute as @e[tag=ray] at @s unless block ~ ~ ~ air store success entity @s Duration int 0 run setblock ~ ~ ~ red_wool replace
Tag entity on hit:
RUA: execute as @e[tag=ray] at @s run tag @e[distance=0.1..1, type=!player] add hitMe
CUA: kill @e[tag=hitMe]
CCA: kill @e[tag=ray]
Test particles:
RUA: execute at @e[tag=ray] run particle flame ~ ~ ~ 0 0 0 0 1 normal
Other Videos By Infernal Device
Other Statistics
Minecraft Statistics For Infernal Device
At present, Infernal Device has 182,428 views spread across 865 videos for Minecraft, accounting for over 10 days of watchable video on his channel. This is 94.82% of the total watchable video for Minecraft on Infernal Device's YouTube channel.