[MC-8966] /clear <player> <item id> Not functioning as expected Created: 01/Feb/13  Updated: 29/Dec/17  Resolved: 05/Apr/13

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.7, Snapshot 13w04a, Snapshot 13w05a, Snapshot 13w05b
Fix Version/s: Minecraft 1.5

Type: Bug
Reporter: Tristan Abshire Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: command, command_block, redstone

Issue Links:
Duplicate
is duplicated by MC-8120 The /clear command used with a comman... Resolved
Confirmation Status: Unconfirmed

 Description   

When attaching a comparator to a command block which has the command "/clear <player> <item id>", the comparator will return true, even if the item in question is not removed from the players inventory.

I expected it to not output a redstone signal at all if there were no items removed. However it appears that the only way for that to happen is for that player to not exist on the server



 Comments   
Comment by Tails [ 05/Apr/13 ]

You're right it has been fixed like originaly requested. Thanks for pointing that out.

Comment by stephen walsh [ 05/Apr/13 ]

It seems they no longer function this way, but rather the way you had originally thought it should. I've done tests with this, and it only outputs a signal if the item is cleared. This is why I opened a separate issue; the enchant command outputs a signal if no item is enchanted. Why is inconsistant command block behavior not considered a bug? This issue has been resolved, and works just like the original poster thought it should. My issue has not been resolved, and thus should not have been flagged as a duplicate, unless there is some command block behavior I'm simply not understanding.

Comment by [Mod] CubeTheThird [ 04/Feb/13 ]

Seems I was partially mistaken. Any command successfully executed will output a signal. If the command was /testfor, the signal strength will be based on the number of players it found. The command /clear therefore works as intended.

Comment by Tristan Abshire [ 02/Feb/13 ]

It should then only output the number of players it does change then, shouldn't it?

I mean, personally, here's how I think the scenario would go around if it were actual people.
You got 5 people, 3 of whom have various amounts of apples.
The admin says, "I'm going to take everyone's apples" and proceeds to do so.
He takes apples from the three who have them, therefore succeeding.
He cannot take apples from the other two, because they do not have any, therefore a fail.

Comment by [Mod] CubeTheThird [ 01/Feb/13 ]

The signal strength is based on the number of players on which the command is used, regardless if the command makes any changes.

Generated at Sun Jan 12 12:19:31 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.