I have a raycasting function that works as follows:
– command –
execute as @n[type=villager] at @s anchored eyes run function poltergust:raycast
– raycast –
scoreboard players set limit raycast 20
function datapacktest:rayloop
– rayloop –
scoreboard players remove limit raycast 1
execute unless block ~ ~ ~ #poltergust:camerapass run scoreboard players set limit raycast 0
particle dust{color:[0.733,0.733,0.733],scale:0.5} ~ ~ ~ 0.25 0.25 0.25 0 5
execute if score limit raycast matches 1.. positioned ^ ^ ^0.3 if block ~ ~ ~ air unless entity @e[distance=..0.3,type=!player,type=!villager] run function datapacktest:rayloop
—
This does send out a raycast but it is unaffected by the villager's vertical rotation value. When I run the raycast for myself, the raycast works vertically as expected.
EDIT: Nevermind, it was an order of operations issue lol
In the example images, the villager's rotation is being set to mine