Jump to content

[1.7.10] Get the Player who destroyed the block [SOLVED]


Recommended Posts

Hello I'm working on my Advanced Dispensers Mod, and I  have a Question. Is it possible to get the EntityLivingBase of the Entity who destroyed a Block?

In 1.5 there was a function called onBlockDestroyedBy, which had the LivingBase as argument, but the onDestroyedByPlayer doesn't have this any more.

Link to comment
Share on other sites

I don't think there is one with EntityLivingBase, but there is onBlockHarvested with an EntityPlayer instance. There is also onBlockPreDestroyed, but it doesn't have an EntityPlayer field.


Lastly, you have the BlockEvent.BreakEvent you can use, with getPlayer().



I'll help if I can. Apologies if I do something obviously stupid. :D


If you don't know basic Java yet, go and follow these tutorials.

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.

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.

  • Create New...

Important Information

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