Jump to content

[Unsolved] Adding Forge Event Handlers


Recommended Posts

Hello forge community.  I have been apprehensive to post a question in here as I have much to learn and it appears that people that are new often get crucified for asking questions the advanced would see as simple... How ever, I feel that I have looked high and low and would like conformation that my findings are correct.


I am looking for an event listener that deals with blocks.  Actually the following link pretty much sums it up.




After days of going through the code I finally stumbled on the above entry.  It is quite old and I didn't want to resurrect  the thread.


The particular event I am interested in is one that fires when a player destroys a block, adds a block and when a block is blown up.


I know that by doing the following:


    public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, 
                int par4, int par5){
    System.out.println("The block was destroyed");


You can get access to this event but only for blocks that you create.


My question is, Do I have to go in and add the events to one of the net.minecraftforge.event packages, modify some of the base classes or look harder because there is a way that I am missing.


I thank you in advance for your time and assistance.

Link to comment
Share on other sites

Hello forge community.  I have been apprehensive to post a question in here as I have much to learn and it appears that people that are new often get crucified for asking questions the advanced would see as simple...


That's wrong, I can only speak for myself of course but I only crucify people for the following reasons:

- Asking for help with crash, bugs etc. but not giving Code/Logs inn readable format. (use pastebin ppl!).

- When people ask for stuff they didn't care to google themselfs.

- people refusing to learn what they are doing and instead just want their mod given to them.


So feel free to ask any and all questions you may have related to modding, as long as you actually tried to avoid the above points you will be fine <3


And for your real question. Well good question, I'm not sure about event listeners for that but I'll try to check around when I get to my eclipse computer :)


If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

I have been programming since I was 13 years old and am now 29.  I am no where near an expert programmer, but am able to jump in and out of many languages.  While, I do not have very much experience with Java, it is very similar to many other languages.  At no point would I expect somebody to write my mod as I care less about the end state of the mod than I do the learning experience of getting there.


I appreciate you taking the time to look this subject up but I fear that you are going to find the same results as I did.


I see that forge has some hooks put in various classes that pertain to events that are fired and are able to build there wrapper around those hooks.  It almost looks to me like that area just has not really been fully completed.  I would really like access to more events that are fired and do not really want to modify forge or minecraft classes.  Making a forge mod that is incompatible with other forge mods completely defeats the purpose of using forge.

Link to comment
Share on other sites

I am quite sure that this is functionality that many mods could take advantage of.  Is there anybody out there that could help point me in the rite direction?  As of the time of writing this, there has been 55 views in a short two days.  It is apparent that there are a few people out there that have taken an interest in this.


As of rite now, I do not have anything further to add to this but will be attempting to modify forge and some of the base classes that are involved in order to try and add this functionality.  If there is anybody out there that has any advice or fore sight that would be useful to me before I attempt this, it would be greatly appreciated.


Thank forge community.

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.