0
\$\begingroup\$

I want to make the strength of the iron block and obsidian switch places, along with other changes to block strength and blast resistance. I am not allowed to swap the textures or anything like that. I need to actually change the values of each block.

To do this, I need to know where Minecraft stores the blast resistance and hardness.

Is decompilation required? If so, which class file do I need to look into?

\$\endgroup\$
5
  • \$\begingroup\$ Is it not easier to just retexture the two blocks? \$\endgroup\$
    – Bálint
    Jul 31, 2019 at 10:47
  • \$\begingroup\$ @Bálint there are other changes to blast resistance and hardness I want to make, so retexturing them won't do the trick \$\endgroup\$
    – user124114
    Jul 31, 2019 at 15:26
  • \$\begingroup\$ Please do not make vacuous edits to bump questions. The Community user will auto-bump questions periodically, so there's no need to vandalize posts to get that effect. If you want to make a quality edit that will actually help attract answers, try adding new information to the question, like some background about what you're trying to do, or samples of how you've tried implementing it thus far. \$\endgroup\$
    – DMGregory
    Sep 20, 2019 at 10:54
  • \$\begingroup\$ @DMGregory I really need a fruitful answer, how else will I get one \$\endgroup\$
    – user124114
    Sep 25, 2019 at 2:55
  • 2
    \$\begingroup\$ Once again, bump edits do not help you get answers. Neither does cursing. Making improvements, as described in the comment above, does help attract answers. I won't repeat this again - if you want answers, I recommend following the advice you've been given. \$\endgroup\$
    – DMGregory
    Sep 25, 2019 at 3:01

1 Answer 1

0
\$\begingroup\$

Info: You gave no information how you are making your mod so I assume you are using forge.

All Blocks can be accessed via the Block class.

The attributes you want to change are called:

  • Hardness: This defines how often you have to mine the block for it to break
  • Resistance: This defines the Blast resistance

To set these you can use the provided setter functions, e.g.:

Block.obsidian.setHardness(2.5);

or

Block.obsidian.setResistance (25);

See the documentation for full explanation.

\$\endgroup\$

You must log in to answer this question.