Jump to content

Custom Harvest Levels


BloodshotPico

Recommended Posts

Hello so I was wondering if I am to have a Block let's say for example Ruby Ore, and this Ruby Ore needs level 4 harvest level = Meaning diamond cannot mine it, how would this be done since this is currently what I have for my code:

setSoundType(SoundType.STONE);
		setHardness(5.0F);
		setResistance(30.0F);
		setHarvestLevel("pickaxe", 12);
		
		//Sets the Light Level (Makes the block emit light)
		//setLightLevel(1.0F);
		
		//Sets the Opacity Level (Makes the block like glass)
		//setLightOpacity(1);
		
		//Makes the block unbreakable
		//setBlockUnbreakable();

How come a diamond pick can still mine this? What would I have to do to make "more/new" harvest levels?

 

Source:

https://github.com/BloodshotPico/GemsAndMinerals

 

~Blood

Edited by BloodshotPico
Added source link
Link to comment
Share on other sites

54 minutes ago, BloodshotPico said:

How come a diamond pick can still mine this? What would I have to do to make "more/new" harvest levels?

Did you know that an Iron pickaxe can still mine obsidian, but it just can't harvest obsidian. Does your block drop itself when mined by diamond?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

29 minutes ago, BloodshotPico said:

No it drops the gem instead.

Try changing the Material you are using.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

8 minutes ago, BloodshotPico said:

This happens for all my materials.

I'm not sure you understood what I meant, I meant change your ores material from Material.GROUND to Material.ROCK

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Absolutely, that's required. In the Material class, you'll find that only some of the default materials for blocks invoke a method that causes them to require a tool. Material.ROCK is one of them; Material.GROUND is not, which is why you can break dirt with your hand but a shovel mines it faster. (Note: If this is considered a necropost, feel free to delete, if you have the permissions to do so. Just trying to be helpful.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.