Raycasting Generator

Create a raycasting data pack based on vdvman1's raycasting template. View the original here.


Maximum steps possible
{{ total_steps }}

Entity commands

Specify the commands you wish to run when the entity raycasting succeeds.

The entity that was found can be targeted with @s while the execution position is at the hit position. The position of the hit entity can be targeted with execute at @s.

Block commands

Specify the commands you wish to run when the block raycasting succeeds.

The execution position is at the block that was found, such that writing setblock ~ ~ ~ minecraft:air will delete the block.

Before raycasting

Specify the optional commands to run before the selected entity begins the raycast. You can use this to, for example, play a sound to indicate that the raycast has started (such as a sound of a laser being fired).

Raycasting failed

Specify the optional commands you wish to run when the raycast finishes without succeeding. The execution position will be at the end of the raycast. Use execute at @s to go back to the executor if needed.

After raycasting

Specify the optional commands to run after the raycast fully ends for the entity, regardless of whether or not the raycast succeeded. The position will be at the original entity that started the raycast.

Per-step

Specify the optional commands to run at each step of the raycast. This can be used to, for example, create a line of particles.