Jump to content

[1.7.2] Comprehensive list of Forge events?


robertkhamilton

Recommended Posts

Hi all,

 

I've recently posted my first Mod (OSCCraft) which embeds an Open Sound Control implementation into Minecraft (Forge 1.7.2). For those who don't know it, OSC is a messaging protocol (UDP or TCP) that is commonly used in interactive music or media systems to pass data from one system to the next (like MIDI but more flexible).

 

I've so far figured out a few key events to monitor, mostly by trial and error, and was wondering if there's a comprehensive list or easy place to see all the events that Forge can access?

 

For instance, I'm using net.minecraftforge.event.entity.player.PlayerInteractEvent to track Client position and rotation and using net.minecraftforge.event.world.BlockEvent.BreakEvent to track which blocks are being broken at any given time.

 

I'm an experienced programmer and have already explored much of this using the Minecraft deobfuscated source without Forge, but would prefer to keep the project Forge loadable.

 

Thanks,

 

Rob

 

---------------

rob hamilton

center for computer research in music and acoustics

stanford university

http://ccrma.stanford.edu/~rob

https://github.com/robertkhamilton/osccraft

 

Link to comment
Share on other sites

Thanks coolAlias,

 

After reading through these and looking around a bit I'm realizing that accessing these events is only one way to mod with Forge (apologies for my neubosity)?

 

Is the use of Transformers what I should really be looking into? i.e. http://www.minecraftforge.net/wiki/Using_Access_Transformers

 

For instance, if I wanted to fire a message when a new block is created by a Client, like "onBlockPlacedBy" in Block, since there's no Event for that, I would instead have to override that method with an Access Transformer?

 

 

Link to comment
Share on other sites

If you want the message to appear for your custom blocks, then no, you can just override the onBlockPlacedBy method in your custom block class; if you want a message to appear for ALL blocks placed, then the simplest solution is to use PlayerInteractEvent for Action.RIGHT_CLICK_BLOCK. Access Transformers are needed less and less as Forge becomes more sophisticated (Forge uses them behind the scenes to make modding much easier for the rest of us).

Link to comment
Share on other sites

This would work for most cases, however PlayerInteractEvent for Action.RIGHT_CLICK_BLOCK also fires a false positive when Right click is selected but no block is placed (such as in the case where a user is standing too close to the block on which they're clicking).

 

Would be nice if there was a way to tell if the block was actually placed, not just that a user right-clicked on a block.

 

I guess one solution would be to check the face on which the click event occurred, then based on that face, check the position to see if a block exists or not; if the block exists then the placing was successful. Seems pretty painful to just check if a block was successfully placed though.

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.

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.