Jump to content

[SOLVED] Change which blocks can be harvested with bare hands


Recommended Posts

Posted

I did some searching and all I found was this thread which is 3 years old. I want to edit the set of blocks which can be harvested without holding a tool. For example, I want the player to be unable to harvest dirt blocks without a shovel.

 

Is this possible to do? If so, does the method in the thread I linked to still work or is there a different way to do it? Is it possible to make a block breakable but not harvestable (like breaking stone with bare hands in vanilla) - or is it only possible to make a block unbreakable by hand?

 

Edit: Solved by using

PlayerEvent.BreakSpeed

to change how long it takes to break the block and

HarvestDropsEvent

to remove the drops for blocks which I want to be un-harvestable.

Posted

You'll probably want to subscribe to

PlayerEvent.BreakSpeed

to slow down the breaking and

BlockEvent.HarvestDropsEvent

to remove the drops.

 

I do something similar here, but this prevents the block from being broken at all unless the player has the correct tool.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.