i want to create an item that teleports the player 5 blocks in the direction they're facing, but stop at a solid block if it exists (like Ender Pearls). Also add a 5-second cooldown. i have been searching guides all over the internet please help.
create a producer and associate it with the right click trigger on your item
create two number variables (there value is not impotent now), name them something like targetPosX and targetPosZ
use if block to find if you will collide with solid block
the producer goes like this:
set number Global: targetPosX to x position of source entity + X value of look angle vector of source entity * 5
set number Global: targetPosZ to Z position of source entity + Z value of look angle vector of source entity * 5
set location of source entity to X: Get number Global: targetPosX Y: Y Z: Get number Global: targetPosZ
its something like that:
create a producer and associate it with the right click trigger on your item
create two number variables (there value is not impotent now), name them something like targetPosX and targetPosZ
use if block to find if you will collide with solid block
the producer goes like this: