mojira.dev
MC-264145

Failed execute ... if/unless score ... subcommand incorrectly shows "unknown or incomplete command" error

/execute at @s if score @s RCC = @e[type=minecraft:interaction,dy=2,sort=nearest,limit=1] RCC if score @s TPS matches 3 run say hi

I am sure that I have set the scoreboard
this command is 100% correct

but it told me that
[System] [CHAT] Unknown or incomplete command, see below for error
[System] [CHAT] ...run say hi<--[HERE]

I tried to simplify the command
/execute as @a at @s if score @s RCC = @e[type=minecraft:interaction,limit=1] RCC run say hi

but this command run well
/execute as @a at @s if score @s RCC = @e[type=minecraft:husk,limit=1] RCC run say hi

Sorry for my bad English :C

Linked issues

Attachments

Comments 6

Confirmed, somehow it throws "Unknown command" errors if an execute if/unless score subcommand chain fails for any reason (not finding an entity or the objective not existing).
Other execute subcommands (such as execute if/unless entity) don't do that.

I suggest making this more clear in the report; and in the future do a little more testing. 😉

I also encountered this problem and I did a little bit of testing.

The problem comes when you want to use something else than @s or a playername for the target that is used for the score
You always get an error if you try to search for an entity in a distance of less than 2 blocks, does not matter if you use =1 or =..1
You always get an error if you use the level attribute
You get the error when you use the team=# attribute
I think you get the error if you use the x=#, dx=# and the x_rotation=#, attribute
That were all cases where I got the error. I hope that helps a little bit

When I tested, I simply used a non-existent objective and @s, it gave the error, existing objective and @s, no error, existing objective and @e[type=zombie,limit=1] without any zombies in the world, it gave the error again.

What you use in the selector has no relation to this issue.

Maybe I should have given the Test Conditions.
I used a marker for every Attribute except the ones that are player specific like level or gamemode.
I always made sure the test conditions are true at least once, means if I searched for an entity within a 0.2 block distance I made sure it is within a 0.2 block distance, so it wouldn't make that much sence if it doesn't depend on the selector.

It's at least possible that my specific test conditions revealed another unrelated Bug

Let's make it clear. If your selector didn't find any entity, it shows such error.

Can compare to /data .

This was fixed in 23w41a

andyma000

(Unassigned)

Confirmed

Platform

Normal

Commands

1.20.1

Retrieved