[TUTORIAL] How to fix Harvest Level for Blocks on 2021.1 Snapshot

Started by SparkleArts on

Topic category: Advanced modding

Active 1 day ago
Joined Feb 2018
Points:
1986

User statistics:

  • Modifications: 1
  • Forum topics: 163
  • Wiki pages: 0
  • MCreator plugins: 3
  • Comments: 785
[TUTORIAL] How to fix Harvest Level for Blocks on 2021.1 Snapshot
Tue, 02/23/2021 - 09:34 (edited)

Hello Guys,

today I want to show you how you can solve the harvest level problem in MCreator 2021.1(03117).

But what exactly is this harvest level problem?

For example, if you set the harvest level of your block to 4, so that the block can only be mined for Netherite tools (so that the block drops) you can use all other tools to mine and you also get the drop that you should only get from Netherite.

Why is this problem?

Quite simply, the code of your block (.java file) is missing a certain code that leads to this problem.

How do you fix the problem?

Go to the mod element of your block and select 'Edit Code' and then click on the only .java file.

Then you look for this line:

Harvest Level Line

Then add this code:

.setRequiresTool()

 exactly after:

(ToolType.PICKAXE)

Then press CTRL+S to save the code.

To save Mod Element Codes you need to lock the Code.

I hope this Tutorial helped you out!

Edited by SparkleArts on Tue, 02/23/2021 - 09:34
Active 1 year ago
Joined Jul 2021
Points:
625

User statistics:

  • Modifications: 0
  • Forum topics: 25
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 48
could you help me with 2021…
Sun, 05/01/2022 - 18:35

could you help me with 2021.3? its the same issue in a way, i want to mine a tree with an axe and my hand but it wont let me have both, and the names are a bit different, like instead of .setRequiresTool() , its requiresCorrectToolForDrops())

Active 1 day ago
Joined Feb 2018
Points:
1986

User statistics:

  • Modifications: 1
  • Forum topics: 163
  • Wiki pages: 0
  • MCreator plugins: 3
  • Comments: 785
crowinsanity13, you should…
Wed, 05/25/2022 - 04:21

crowinsanity13,

you should know that in the future MC Versions some Codes like the ".setRequiresTool()" can change. And this Tutorial is only for 2021.1.

Active 1 hour ago
Joined Nov 2024
Points:
13

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
so im im looking at the area…
Mon, 02/17/2025 - 21:37

so im im looking at the area and it doesnt look like yours, im in 2021.1

Active 1 hour ago
Joined Nov 2024
Points:
13

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
forgot to post a link to the…
Mon, 02/17/2025 - 21:38

forgot to post a link to the image 

 

https://ibb.co/6Rh1JTqk