mojira.dev
MCPE-222490

query.is_carrying_block cannot be used on the off-hand, unlike other held item queries

The query.is_carrying_block query was updated in 1.21.100.21 to work on all entities instead of just Endermen. However, unlike other held item queries, this query cannot be used to check the off-hand.

As a creator of a resource pack which changes held item poses, it is important to be able to pick which hand gets queried each time. Instead, this query always checks the main hand.

Query Name

Supports Main Hand

Supports Off Hand

query.get_equipped_item_name

query.is_item_name_any

query.equipped_item_is_attachable

query.is_carrying_block

This makes the new query an outlier, as all other item queries can be used with the off-hand slot.

Expected Results

query.is_carrying_block('off_hand') can be used to check the off-hand slot, like other held item queries.

Observed Results

query.is_carrying_block('off_hand') still checks the main-hand slot.

Attachments

Comments 2

Thank you for your report!

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

Could you please attach an example addon showcasing the issue?

This ticket will automatically reopen when you reply.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

Here is a sample pack.

Steps to Reproduce

  1. Import and apply is_carrying_block_sample_pack in the latest preview. (1.21.100+)

  2. Enter a world with Cheats enabled.

  3. Switch to third person front camera so you can see yourself.

  4. Run the following command:

    /replaceitem entity @s slot.weapon.offhand 0 amethyst_block
  5. If the is_carrying_block query worked correctly with the offhand, the player’s head would now be floating.

  6. Observe that the player head is not floating.

  7. Run the following command:

    /replaceitem entity @s slot.weapon.mainhand 0 amethyst_block
  8. Observe that the player head floats.

  9. This means query.is_carrying_block always checks the main hand, even when the offhand is specified, which confirms the issue.

This is the animation used in the sample pack. It is formatted correctly:

[media]

Holding offhand block (Head should be floating, but it’s not):

[media]

Holding mainhand block (Head should not float, but it does):

[media]

Sample pack required to reproduce:

[media]

AgentMindStorm2

(Unassigned)

1436349

Plausible

Multiple

Windows 10

1.21.100.21 Preview

Retrieved