Jump to content

Modifying Forge/determining when an Enderman picks up a block


Recommended Posts

Posted

I'm trying to determine when an enderman picks up a block.

I've looked into subscribing to the EntityEvent, LivingEvent, LivingUpdateEvent, BlockEvent, EntityMobGriefingEvent, and some others. I looked a little bit into the mapped source for the EndermanEntity, and I actually found what appear to be oversights that make this task that much harder if not impossible. First, the EntityMobGriefingEvent isn't fired at the right time, and instead it's fired much earlier than when a block is actually trying to be broken/placed. Even if it were fired at the right time, then it still wouldn't be able to distinguish between and enderman picking up or placing down a block. It seems like either a new event is needed or the TakeBlockGoal should post a LivingDestroyBlockEvent.

 

If anyone has any ideas on how to determine if the enderman picks up a block or not, please feel free to chime in.

 

Otherwise, I would like to modify the Minecraft Forge EndermanEntity file myself and would appreciate any direction on this topic.

Posted

Yeah, there's no good way to detect this right now.

Its based on several random variables and the EntityMobGriefingEvent simply determines whether or not the endermen are allowed to make that random check (which can still fail).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

 So should I just create a pull request? It seems like there's already a good event for this sort of thing (LivingDestroyBlockEvent) and I could add a single line of code to fix this issue.

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.