Mojira Archive
MC-279116

Local coordinates do not work for mobs

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

Invalid

Master L

2025-01-03, 03:17 AM

2025-01-03, 04:59 AM

2025-01-03, 04:59 AM

0

0

Unconfirmed

(Unassigned)

1.21.4

-