TransWikia.com

How to add data to json tags MCPE

Arqade Asked by Zackery Spry on August 4, 2021

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?

One Answer

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.

Correct answer by Penguin on August 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP