0

I want to /give a iron shovel that can break coarse dirt for my map. I tried the following command:

/give @a iron_shovel 1 0 {"can_destroy":{"blocks":["coarse_dirt"]}}

But it turns out coarse dirt is just dirt with data 1. How can I do this?

2
  • Was the slash on purposely put backward? I have to put an answer because I don't have commenting perms. Commented Nov 7, 2020 at 18:41
  • 1
    @Eristheguest no, the slash is the right way. Commented Nov 10, 2020 at 13:44

1 Answer 1

0

Data? No.

The issue is coarse_dirt is not a block. Coarse dirt has the ID dirt and is of data 1. There is no way to put data in can destroy/place ons so use the command:

/give @a iron_shovel 1 0 {"can_destroy":{"blocks":["dirt"]}}

Unfortunately this will allow the shovel to break regular dirt and coarse dirt.


Possible Workaround

If you are just making this for yourself and/or friends or plan on distributing a world download, you can use either of the following:

Resource Packs

Change a rarely used block/a block that you are not using and instead of its default texture assign it to the coarse dirt's texture (don't just copy-paste the PNG file, modify the blocks.json so if someone has a texture pack it will look normal).

Behaviour Packs + Resource Packs

Add an entirely new block to the game and assign the coarse dirt texture to it (don't just copy-paste the PNG file, modify the blocks.json so if someone has a texture pack it will look normal).


I won't explain how to create a resource/behaviour pack in this answer because that veers off-course from the question.

2
  • I want to allow course dirt to be broken, though. And it is "can_destroy" not "can_break" Commented Nov 10, 2020 at 13:46
  • @ZackerySpry that's not possible
    – Penguin
    Commented Nov 10, 2020 at 15:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .