mojira.dev
BDS-9536

BDS query.get_equipped_item_name always returns null/empty string

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.

Linked issues

Comments 12

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.

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.

happens in 1.16.40

happens in 1.16.40

should be part of BDS bug report type though

2 more comments

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.

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).

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).

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.

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.

Zizzy zizzy

(Unassigned)

Community Consensus

Retrieved