Reslekan Posted October 23, 2012 Posted October 23, 2012 Hello! 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! Quote
keepcalm Posted October 23, 2012 Posted October 23, 2012 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 Quote 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! http://bit.ly/HZ03zy[/img] Tired of waiting for mods to port to bukkit? use BukkitForge! (now with a working version of WorldEdit!)
Reslekan Posted October 24, 2012 Author Posted October 24, 2012 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... --- Edit: 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! Quote
Recommended Posts
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.