mojira.dev
MCPE-136134

Items equipped to hands are not counted by q.equipment_count

The query q.equipment_count does not count items equipped to either a mob’s main hand or its off-hand.

Steps to reproduce

  1. Load a world with

[media]
  1. . This pack adds an animation to bats that makes them spawn a codfish when q.equipment_count is 1 or greater.

  2. Spawn a bat and run /replaceitem entity @e[type = bat] slot.weapon.mainhand 0 iron_sword

  3. Spawn a bat and run /replaceitem entity @e[type = bat] slot.weapon.offhand 0 shield

  4. Spawn a bat and run /replaceitem entity @e[type = bat] slot.armor.head 0 golden_helmet

Expected result

Each bat spawns a codfish.

Observed result

The bats in steps (2)-(3) do not spawn codfish. Only the bat in step (4) spawns a codfish.

Linked issues

Attachments

Comments 4

EveryCabbage884

Resolving temporarily as Awaiting Response. Could you please attach the add-ons you're using to this ticket?

Turns out I was mistaken about the has_equipment filter, it looks like I may have been dealing with a separate bug with adding a specific behavior component.

However, the issue exists for q.equipment_count and I have attached a pack to demonstrate.

The 1.19.30.22 Preview changelog seems to imply that this is Working As Intended.

  • Clarified the documentation for equipment_count to indicate it only counts equipped armor, and how to query for held items (MCPE-136134)

The same statement was included in the 1.19.30 changelog. I agree that the implication is that it's Working As Intended, so I'm closing the ticket.

GoldenHelmet

(Unassigned)

579161

Confirmed

Windows

1.17.10, 1.19.20

Retrieved