[BDS-9536] BDS query.get_equipped_item_name always returns null/empty string Created: 24/Aug/20  Updated: 25/Feb/21  Resolved: 25/Feb/21

Status: Resolved
Project: Bedrock Dedicated Server
Affects Version/s: 1.16.40
Fix Version/s: None

Type: Bug
Reporter: Zizzy zizzy Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 5
Labels: None

Issue Links:
Relates
relates to BDS-7012 animation_controller files in behavio... Resolved
Confirmation Status: Community Consensus
ADO: 427512

 Description   

This code works fine in Windows 10 single-player:

 

{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.appletest": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "eating": "query.is_using_item && query.get_equipped_item_name('main_hand') == 'apple' && query.item_in_use_duration >= 640"
            }
          ]
        },
        "eating": {
          "on_entry": [
            "/say i've eaten an apple!"
          ],
          "transitions": [
            {
              "default": "!query.is_using_item || query.item_in_use_duration < 640 || query.get_equipped_item_name('main_hand') != 'apple'"
            }
          ]
        }
      }
    }
  }
}

 

The exact same code is completely broken in BDS 1.16.20.03. Any custom items that require the get_equipped_item_name query no longer work due to it always returning a blank string.

 

I also tried the most basic test in a custom animation controller:

 

{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.appletest": {
      "initial_state": "default",
      "states": {
        "default": {
          "transitions": [
            {
              "eating": "query.is_using_item && query.get_equipped_item_name('main_hand') == 'apple'"
            }
          ]
        },
        "eating": {
          "on_entry": [
            "/say i've eaten an apple!"
          ],
          "transitions": [
            {
              "default": "!query.is_using_item"
            }
          ]
        }
      }
    }
  }
}

This doesn't work either. query.is_using_item is working only by itself. As soon as I add query.get_equipped_item_name, it breaks because of the empty string.



 Comments   
Comment by Zizzy zizzy [ 17/Nov/20 ]

This has been fixed in 1.16.100.

However, this is beginning to get comical. Now any entity spawned from anything that shoots no longer moves. It just spawns and hovers with no velocity, both in single player and on BDS. I'll open yet another new bug report.

Comment by user-6d71e (Inactive) [ 15/Nov/20 ]

Has this bug been fixed in the current beta? Many changes to how the game handles names have been tweaked, but it is not clear whether this has or has had an affect on the BDS for the would-be 1.16.100 update (since we are not able to test it).

Comment by ambient [ 31/Oct/20 ]

I should also note that this bug occurs for vanilla items and custom ones. Yes, the custom items have been defined in the Lang file.

Comment by ambient [ 06/Oct/20 ]

should be part of BDS bug report type though

Comment by ambient [ 06/Oct/20 ]

happens in 1.16.40

Comment by user-893ae (Inactive) [ 24/Aug/20 ]

I've been trying to run an event using this query, and found out it never works! it's one of the most used queries, so it hopefully will get a fix soon.

Generated at Sat Jan 11 07:48:31 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.