1

I would like to test if the player has say, an empty bucket in their inventory, and replace it with a filled lava bucket. It only works if the stack size of the buckets is 1, and works in any inventory or hotbar slot.

I have a similar working command: /replaceitem entity @a slot.hotbar.8 minecraft:wool 1 11 {HideFlags:1,ench:[{id:71,lvl:1}]}

But this does 2 things wrong: first, it sets hotbar slot 8 to wool regardless of what is already in that slot, and it only sets slot 8 specifically.

Edit: I'm on 1.12

  • And what is your question? Apart from that, the two things you mention seem unrelated: what is their connection? – Joachim May 24 at 10:44
  • "I would like to test if the player has say, an empty bucket in their inventory, and replace it with a filled lava bucket." "This does 2 things wrong: first, it sets hotbar slot 8 to wool regardless of what is already in that slot, and it only sets slot 8 specifically." – user251956 May 26 at 13:52
2

You can't do that dynamically, you need one command per item. You basically need the commands from this answer.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy