Data Packs Other

Raycasting Engine/Framework

  • 4k views 0 today
  • save_alt 442 downloads
Compatibility
Minecraft 1.16
Changes include
  • Functions
  • 10
  • 7
itskegnh
Lvl 10Journeyman Miner
0
Raycasting Framework.



Inside each function file comments are shown to help you edit and understand the basics of raycasting.

The function file ray:ray_hit will be run if a block is detected/hit.

Inside the ray:loop_ray function, you can edit the maximum range of the ray, the length between points of the ray (default 0.2).



Everything in this datapack is made to be used by others.



You could for example make a custom lightning wand, where when you click with a specific item it raycasts and summons lightning.

Lightning Wand - (inside the ray_hit function)
execute if entity @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick", Count:1b, tag:{lightning_wand:1b}}}] run summon lightning_bolt ~ ~ ~

because the ray_hit function is run as the player, at the ray collision location we can summon lightning if ourselves are holding a specific item.

More like this

  Have something to say?

Welcome