208: Experimental - Levitating blocks with raycast. No Datapack. [Minecraft Map Making]

Subscribers:
3,860
Published on ● Video Link: https://www.youtube.com/watch?v=hr5BOBLqiiw



Minecraft
Game:
Minecraft (2011)
Duration: 36:20
302 views
17


Ep208: NOTE: This is experimental and not perfect, it's more of a slowcast, but I thought some people may want to see it. If you do wish to use raycasting in your maps then it is much better to use Datapacks. This is more for fun. :)

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
CUA: scoreboard objectives add xPos dummy
CUA: scoreboard objectives add yPos dummy
CUA: scoreboard objectives add zPos dummy

Give wand:
IUN: give @p carrot_on_a_stick{raycast:true}

Debug particles:
RUA: execute at @e[tag=ray] run particle flame ~ ~ ~ 0 0 0 0 1 normal
CUA: execute at @e[tag=moveMarker] run particle electric_spark ~ ~ ~ 0 0 0 0 1 normal

Move ray:
RUA: execute as @e[tag=ray] at @s if block ~ ~ ~ air run tp ^ ^ ^0.3

Teleport moveMarker:
RUA: execute at @p[tag=isCasting] run tp @e[tag=moveMarker] ^ ^1.5 ^4
CUA: execute as @e[tag=moveMarker] at @s align xyz positioned ~.5 ~ ~.5 run tp @s ~ ~ ~

Move block to marker:
RUA: execute as @e[tag=moveMe] store result score @s xPos run data get entity @s Pos[0] 1000
CUA: execute as @e[tag=moveMe] store result score @s yPos run data get entity @s Pos[1] 1000
CUA: execute as @e[tag=moveMe] store result score @s zPos run data get entity @s Pos[2] 1000
CUA: execute as @e[tag=moveMarker] store result score @s xPos run data get entity @s Pos[0] 1000
CUA: execute as @e[tag=moveMarker] store result score @s yPos run data get entity @s Pos[1] 1000
CUA: execute as @e[tag=moveMarker] store result score @s zPos run data get entity @s Pos[2] 1000
CUA: scoreboard players operation @e[tag=moveMe] xPos -= @e[tag=moveMarker] xPos
CUA: scoreboard players operation @e[tag=moveMe] yPos -= @e[tag=moveMarker] yPos
CUA: scoreboard players operation @e[tag=moveMe] zPos -= @e[tag=moveMarker] zPos
CUA: execute store result storage data temp.xPos double -.001 run scoreboard players get @e[tag=moveMe,limit=1] xPos
CUA: execute store result storage data temp.yPos double -.001 run scoreboard players get @e[tag=moveMe,limit=1] yPos
CUA: execute store result storage data temp.zPos double -.001 run scoreboard players get @e[tag=moveMe,limit=1] zPos
CUA: execute if entity @p[tag=isCasting] run data modify entity @e[tag=moveMe,limit=1] Motion[0] set from storage data temp.xPos
CUA: execute if entity @p[tag=isCasting] run data modify entity @e[tag=moveMe,limit=1] Motion[1] set from storage data temp.yPos
CUA: execute if entity @p[tag=isCasting] run data modify entity @e[tag=moveMe,limit=1] Motion[2] set from storage data temp.zPos

Raycast:
RUA: execute as @a[scores={raycast=1..}, nbt={SelectedItem:{tag:{raycast:true}}}] run tag @s add raycaster
CUA: execute as @a[tag=raycaster, tag=!isCasting] at @s positioned ~ ~1.5 ~ run summon area_effect_cloud ~ ~ ~ {Tags:["ray"], Radius:0f, Duration:20}
CUA: execute as @a[tag=raycaster, tag=!isCasting] at @s positioned ~ ~1.5 ~ rotated as @s run tp @e[tag=ray,distance=0..0.5] ~ ~ ~ ~ ~
CUA: execute as @a[tag=raycaster, tag=isCasting] run tag @a remove isCasting
CCA: kill @e[tag=moveMarker]
CUA: execute as @e[tag=ray] at @s if block ~ ~ ~ light_gray_wool run setblock ~ ~ ~ air replace
CCA: tag @a add isCasting
CCA: execute at @e[tag=ray] run summon marker ~ ~ ~ {Tags:[moveMarker]}
CCA: execute at @e[tag=ray] align xyz run summon falling_block ~.5 ~.1 ~.5
{Tags:["moveMe"], NoGravity:1b,Glowing:1b,Time:-1000000,DropItem:0,BlockState:{Name:"minecraft:light_gray_wool"}}
CCA: kill @e[tag=ray]
CUA: scoreboard players reset @a raycast
CUA: tag @a remove raycaster
CUA: execute if entity @p[tag=isCasting] run execute as @e[tag=moveMe] store result entity @s Air short -1 run data get entity @s Air
CUA: execute unless entity @e[tag=moveMe] run kill @e[tag=moveMarker]
CUA: execute unless entity @e[tag=moveMe] run tag @a remove isCasting
CUA: execute if entity @e[tag=moveMe] unless entity @p[tag=isCasting] run data merge entity @e[tag=moveMe,limit=1] {NoGravity:0b}







Tags:
minecraft
adventure map
map making
commands
command blocks
1.18
custom commands
redstone
map ideas
map suggesstions
custom maps
1.19



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.