Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-168449

is_sneaking filter returns 0.0 (false) when player is sneaking & has item in main_hand

XMLWordPrintable

    • Confirmed
    • Windows
    • 999130

      To recreate: (allay runtime)

        "on_interact": {
          "filters": {
          // is a player sneaking? working 1.19.63, broken 1.19.70
            "all_of": [
              {"test":"is_family", "subject":"other", "operator":"equals", "value":"player"},
              {"test":"is_sneaking", "subject":"other", "operator":"equals", "value":true}
            ]
          },
          "event": "demo:sneak_mode",
          "target": "self" 
        },
         "swing": true,
         "interact_text": "give",
         "give":true
      

      expected result and (pre- 1.19.70 update) result: demo:sneak_mode event fires, interactive text appears for game controllers "give"

      current result: demo:sneak_mode only fires if player is empty handed. After rigorous testing today, I found out the MOLANG query.is_sneaking is returning a value of 0.0 when player is sneaking, but has item in hand. query.is_sneaking returns 1.0 ONLY if player sneaking AND main_hand is empty.

      Only main_hand was checked in my testing. is_sneaking Filters in other components were not examined by me. Again, this was using an allay runtime on an entitly

            seeit360 Test Pattern
            Votes:
            49 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: