Some specific commands of `execute store result/success ..` do nothing.
It is common to emulate an and-gate like this: `execute store result score result foo if score cond_a foo matches 1 if score cond_b foo matches 1`.
What I expected to happen was...:
I expect that the variable `cond_a foo` is set to 1 if `cond_a` and `cond_b` both match 1. Otherwise the variable `cond_a foo` should be set to 0.
What actually happened was...:
If `cond_a` does not match 1 (aka the first subcommand fails) the value `result` does not get updated at all. This is problematic, because the `result` could be initialized to some arbitrary value other than 0 which will lead to invalid logic.
Steps to Reproduce:
1. create a scoreboard object, for example `scoreboard objectives add foo dummy`
2. set the value `return` of the scoreboard to 1, and the value `zero` to 0: `scoreboard players set result foo 1` and `scoreboard players set zero foo 0`
3. check if the score `zero` matches 1 and if the score `zero` matches 1 (the second condition can be anything but the first check must fail): `execute store result score result foo if score zero foo matches 1 if score zero foo matches 1`
4. Notice that the score `result` still has the value 1, even though it should be zero
Thank you for your report!
We're tracking this issue in MC-125058, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
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! Please report any issues on Discord or Reddit