mojira.dev
MC-63592

replaceitem not working twice

I set up a fill command clock, as set up this command

replaceitem entity @a[score_glass_min=1] slot.armor.head glass

I set my 'glass' score to 1 and found a glass block on my head. I took it off and it was not replaced. I got rid of my glass and it still didn't. I even reset my score to 0, then back to 1; still nothing. Finally, I reset my clock, and my score, then redid the whole thing to the same effect: nothing.

Comments 3

I found the strangest solution. I went along with my plan, and made a command block clear glass before equipping, giving the illusion that the hat's couldn't taken off. Now it works. When I take the hat off, a new one gets put on.

It can still happen in creative mode, because the creative inventory is handled differently than the survival inventory, but it's fixed for survival and adventure mode.

If it happens in creative mode, the slot will be updated the next time a player tries to put a valid item in the slot. Leaving/re-entering the world also fixes it in this creative mode.

Thanks. As long as it works in those gamemodes, I think I'll be fine 🙂

Thomas Wood

michael

Unconfirmed

Minecraft 14w30b

Minecraft 14w31a

Retrieved