mojira.dev
MCPE-168449

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

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

Linked issues

Attachments

Comments 12

I've put another 12 hours into this... as a developer, I understand it could just be me or my code. It isn't. It's not the allay runtime either. after removing the runtime in testing, the problem of not being able to detect when a player is_sneaking with filters or queries if holding an item is a bug.

update: it absolutely could be the allay runtime... I've observed the allay is now showing an open dialog when targeting it and sneaking in an empty experimental world. Issue still exists in 1.19.71

1.19.63 did not show this behavior.

It appeared immediately after 1.19.70 was released. I know many are having issues with sneaking and targeting but I'm confident whatever hotfix comes out will address this issue. I'm sure the developers working on the issue are aware this update was a bit premature and not fully baked. I feel your pain folks.

Thank you for your report!

However, this issue has been temporarily closed as Awaiting Response.

Could you please attach an addon where this issue can be observed?

This ticket will automatically reopen when you reply.

Quick Links:
πŸ““ Issue Guidelines – πŸ’¬ Mojang Support – πŸ““ Project Summary – πŸ“§ Suggestions – πŸ“– Minecraft Wiki

Please reopen. Problem still exists in 1.19.71. Perhaps that in experimental, when you spawn an allay give them an item and target them while sneaking, you get "open" inventory tip when a controller is connected to PC? This behavior did not exist in 1.19.63. As far as sending you my plug-in, I have moved on, and recoded my add-on to not use is_sneaking. But the bug is legitimate and has been refiled as the allay show inventory "open" dialog. Thank you for your consideration.

The issue cannot be retested without an example addon that shows the incorrect behavior. If possible, please create and attach a simple example addon that can be used to test the issue.

This ticket will automatically reopen when you reply.

understood. but I don't have the bandwidth (time) to create use cases at this point. I've made a simpler example of the allay "open while sneaking" behavior and refiled it here -> MCPE-168748

Have a great day friend.

2 more comments

Could you cite specific Marketplace packs/worlds that are broken by this bug?

Nice to see two of my favorite youtubers (FNT and GH) are on this... So If I had a guess, it's an incompatible default behavior combination, in the "minecraft: inventory" component on entities with inventories. MOJANG: Check to see if the flags have been set like this in your runtimes by mistake:

"private": true,
"restrict_to_owner" : true

if this is the default setting in MOJANG's code, you'd block interactions because "open" overrides everything, but the inventory is private so nothing can be done by the owner. That's where I'd start to eliminate that component as one of the causes.

Just ran some testing and all crouching interactions to the allay runtime have been removed by devs changing this:

// pre-1.19.80.24 Preview
      "minecraft:interact": {
        "interactions": [
          {
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "player"
                  }
                ]
              }
            },
            "give_item": true,
            "take_item": true,
            "interact_text": "action.interact.allay"
          }
        ]
      },

to this:

// 1.19.80.24 Preview
"minecraft:interact": {
        "interactions": [
          {
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "player"
                  },
                  {
                    "test": "is_sneaking",
                    "subject": "other",
                    "value": false
                  }
                ]
              }
            },
            "give_item": true,
            "take_item": true,
            "interact_text": "action.interact.allay"
          }
        ]
      },

So technically, I suppose, it's fixed? Just remove all `is_sneaking` interactions... is, well, an interesting tactic. I would have looked for a way to actually fix it, but I guess hiding it so no one can use that interaction on this runtime could be considered a repair. If the door doesn't work, just duct tape it shut. See? fixed. πŸ™‚ Anyway, take care. Sincerely. It's a thankless job. I'll see you on discord.gg/Minecraft

I don't think they will fix this bug if it isn't effecting any marketplaces maps.

Unfortunately this affects maps currently on the marketplace by reducing interactivity of items that use interactions while shifting and holding items. They're not always crucial mechanics but they do exist

Test Pattern

(Unassigned)

999130

Confirmed

Windows

Windows 10

QueryResult, molang

1.19.80.22 Preview, 1.19.70, 1.19.71, 1.19.72, 1.19.73

1.19.80.24 Preview, 1.19.80

Retrieved