-3

Can you help me to add one command to other one? I can do them separated but I can't put them together. Below are the commands

/give @p jukebox 1 0 {CanPlaceOn:["minecraft:melon_block"]}

/give @p jukebox 1 0 {display:{Name:"Box"}}

  • Can you place 2 command blocks for this? It would still be 2 commands, but you could activate both by pressing a single button. – user232393 Jun 26 at 15:28
  • @Mr.Bear Yeah, but he wants one item with both the items. – GamerM Jun 26 at 15:31
  • Oh thank u so much <# @Mr.Bear – Skrampy Jun 26 at 15:44
5

You can add multiple tags (or properties) when giving yourself an item. If you are familiar with JSON it is very similar to that.

In this example CanPlaceOn:["minecraft:melon_block"] and display:{Name:"Box"} are tags, you can add multiple tags to an item by separating it with a comma.

Therefore you can spawn the item using the following:

/give @p jukebox 1 0 {CanPlaceOn:["minecraft:melon_block"],display:{Name:"Box"}}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.