Predicate still passes for certain stacks even after dropping them
The bug
If you drop an item, the predicate will still say you are holding that item, even if there is nothing in your hand. Opening your inventory and clicking on the slot where the item used to be will update it and the using the predicate will result in the correct outcome.
Did not happen in 1.16.5
How to reproduce
- Create a predicate as follows:
{ "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "equipment": { "mainhand": { "nbt": "{Cap:1b}" } } } } - Give yourself a shield with the tag Cap:1b,
/give @s shield{Cap:1b} - Drop the item
- Test the predicate
execute if predicate ...
It will result in "Test Passed"- Go into your inventory and click on your empty selected item slot, then testing the predicate again will result in "Test Failed"
Linked Issues
is duplicated by4
Created Issue:
Predicates still say item is in selected slot even if it isn't
If you drop an item, the predicate will still say you are holding that item, even if there is nothing in your hand. Opening your inventory and clicking on the slot where the item used to be will update it and the using the predicate will result in the correct outcome.
Did not happen in 1.16.5
Steps to Reproduce:
1. Create a predicate as follows:
{ "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "type": "minecraft:player", "equipment": { "mainhand": { "item": "minecraft:shield", "nbt": "{Cap:1b}" } } } }2. Give yourself a shield with the tag Cap:1b,
/give @s shield{Cap:1b}3. Drop the item and type and test the predicate, and it will result in "Test Passed"
4. Go into your inventory and click on your empty selected item slot, then test the predicate, and will result in "Test Failed"
duplicates
Predicatesstillsay item is in selected slot even if it isn'tPredicate still passes for certain stacks even after dropping them
If you drop an item, the predicate will still say you are holding that item, even if there is nothing in your hand. Opening your inventory and clicking on the slot where the item used to be will update it and the using the predicate will result in the correct outcome.
Did not happen in 1.16.5
Steps to Reproduce:
1. Create a predicate as follows:
{ "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "type": "minecraft:player", "equipment": { "mainhand": { "item": "minecraft:shield", "nbt": "{Cap:1b}" } } } }2. Give yourself a shield with the tag Cap:1b,
/give @s shield{Cap:1b}3. Drop the item and type and test the predicate, and it will result in "Test Passed"
4. Go into your inventory and click on your empty selected item slot, then test the predicate, and will result in "Test Failed"
The bug
If you drop an item, the predicate will still say you are holding that item, even if there is nothing in your hand. Opening your inventory and clicking on the slot where the item used to be will update it and the using the predicate will result in the correct outcome.
Did not happen in 1.16.5
How to reproduce
- Create a predicate as follows:
{ "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "equipment": { "mainhand": { "nbt": "{Cap:1b}" } } } }- Give yourself a shield with the tag Cap:1b,
/give @s shield{Cap:1b}- Drop the item
- Test the predicate
execute if predicate ...It will result in "Test Passed"
- Go into your inventory and click on your empty selected item slot, then testing the predicate again will result in "Test Failed"
is duplicated by
is duplicated by
is duplicated by
is duplicated by
Thank you for your report!
We're tracking this issue in MC-229882, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
– I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.
This is internally caused by MC-229882. The item predicate only has an NBT check.
Thank you for your report!
We're tracking this issue in MC-229882, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
– I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.
Duplicate of MC-229882.
Thank you for your report!
We're actually already tracking this issue in MC-229882, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote or any additional information to the main ticket it would be appreciated.
Please be sure to use the search feature before creating a ticket to see if the issue has already been reported.
Quick Links:
📗 Tracker Guidelines – 🛠 Community Support – 📧 Mojang Support – 🔑 Account Support – ✍️ Feedback Discord – 💬 Mojira Discord
See
MC-226525Hi I'm back. Sorry, I misunderstood the issue. As in
MC-226525you do indeed need to update your item key to items, but the problem with dropping sounds more similar toMC-229983. Since I was told this is still an issue, I'll reopen it now and change the title. Sorry about that.It's still an issue in 1.17.1. The mentioned bug don't seem to be exactly related.
Adding items does fix the issue, but you might want to test regardless of the exact item id, and adding the following part still does cause the same issue :
Is there any reasoning behind why this is marked as working as intended? This bug is still present as of 1.18.1, and I don't see any developer comment other than Adrian marking it.
I'd like to request a review for this. The predicate still passing while the item no longer is in the inventory is nonsensical, and the expected behavior would be to only pass if it exists. The fact that clicking on the slot or relogging changes the result makes this look like a desync too.
I'm sorry but why has this been marked as resolved and "works as intended", when it clearly isn't? A predicate that checks for an item in the mainhand with a specific NBT tag can not be considered "working as intended" if it passes when there's no item at all in the player hand.
I'm asking for this to be reopened.
Can confirm in 1.20.3
Does not occur in 1.21.1. It seems it was fixed somewhere between 1.20.4 and 1.21.1
Also here are the commands for recent versions.
/give @s shield[custom_data={Cap:1b}] /execute if predicate {condition:entity_properties,entity:this,predicate:{equipment:{mainhand:{predicates:{custom_data:{Cap:1b}}}}}}It makes sense that this would've been fixed in 1.20.5 when they introduced item components