Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-279116

Local coordinates do not work for mobs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 1.21.4
    • None
    • Unconfirmed
    • (Unassigned)

      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

        1. 2025-01-02_19.16.58.png
          2025-01-02_19.16.58.png
          784 kB
        2. 2025-01-02_19.17.04.png
          2025-01-02_19.17.04.png
          753 kB
        3. 2025-01-02_19.17.16.png
          2025-01-02_19.17.16.png
          742 kB
        4. 2025-01-02_19.17.21.png
          2025-01-02_19.17.21.png
          831 kB

            Unassigned Unassigned
            Master_L_ Master L
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: