Jump to content

Drop on interaction with living mob


Recommended Posts



Forgive my freshness in my stream of questions.  I've only just started programming in Java and modding using Forge so I'm a bit green to it all, though have spent the past few days pouring over code, tutorials and the javadocs to get a few simple mods working.


My question though is this:


I've created a tool that I would like to be used on most mobs in the game, similar to shears though giving a different item in each case.  From what I gather looking over the source, this interaction is handled in mobs class itself.  Would I need to do base edits or is there an event that I can use for this?


I've given a good look but can't see a way to it, so a point in the right direction or some confirmation would be greatly appreciated!

Link to comment
Share on other sites

Is this what you're looking for? When you're looking for events it helps to look in the sub-packages of net.minecraftforge.event

Protip: try and find answers yourself before asking on the forum.

It's pretty likely that there is an answer.


Was I helpful? Give me a thank you!



width=635 height=903http://bit.ly/HZ03zy[/img]



Tired of waiting for mods to port to bukkit?

use BukkitForge! (now with a working version of WorldEdit!)

Link to comment
Share on other sites

I'd spent some time playing with other methods but had little success bar altering damage levels and stack size.  I think that event might be the answer, though my new arrival to Java and Forge leaves me uncertain after a good few hours fiddling with it and trying to implement anything.


The problem I'm having is that I can't get the event itself running, more because I don't fully understand its operation even after reading the javadocs, intro to Events on the Minecraft Forums and the code itself.


I'm getting there the more I play with code and test various functions ingame, I could just do with a little push on the usage of this particular event.  I'm sure it's something glaringly obvious staring me right in the face...






I eventually managed to get something working by reworking some of the shearing code, though it was incredibly sloppy and would never be suitable as it was.  My understanding's growing at least, and I can see now how to use the event to my advantage.  Thanks!

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.