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
Here is a sample pack.
Steps to Reproduce
Import and apply is_carrying_block_sample_pack in the latest preview. (1.21.100+)
Enter a world with Cheats enabled.
Switch to third person front camera so you can see yourself.
Run the following command:
/replaceitem entity @s slot.weapon.offhand 0 amethyst_block
If the is_carrying_block query worked correctly with the offhand, the player’s head would now be floating.
Observe that the player head is not floating.
Run the following command:
/replaceitem entity @s slot.weapon.mainhand 0 amethyst_block
Observe that the player head floats.
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]
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