Jump to content

Logging Events in 1.7.10


Damian3395

Recommended Posts

Hello, I am creating a mod for my school project and I need to log player events into a mysql database. I have logged things such as killing an living entity or crafting an item. Mostly the events from this page: https://dl.dropboxusercontent.com/s/h777x7ugherqs0w/forgeevents.html I am trying to look into getting events such as brewing potions, creating enchanted items, riding an entity, going through a portal, etc... Is there a mod that already exists for these extended events or do I have to create them?

 

Link to comment
Share on other sites

Look at the subclasses of

cpw.mods.fml.common.eventhandler.Event

in your IDE to see which events are provided by Forge.

 

PotionBrewEvent.Pre

/

Post

are fired when a potion is brewed. None of the other events you described are provided by Forge and I'm not aware of any mods that do provide them.

 

In 1.8.9,

EntityTravelToDimensionEvent

is fired when an entity changes dimensions.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

I was trying to use the PotionBrewEvent event, but it does not provide the information on which player has created the potion, only the items created. My group has decided to use 1.7.10 for stability and tutorials. Is there a way to implement custom events, such as interacting with an enchantment table and getting its output?

Link to comment
Share on other sites

I was trying to use the PotionBrewEvent event, but it does not provide the information on which player has created the potion, only the items created.

I imagine that this is because the brewing isn't directly triggered by a player like regular crafting is. The only way to approximate which player brewed the potion is to record who took the resulting potions out of the brewing stand.

 

Is there a way to implement custom events, such as interacting with an enchantment table and getting its output?

Unless you can use an existing hook or event, you'll have to either make a PR to Forge (which is very unlikely to get merged for 1.7.10, since it's now outdated) or resort to ASM.

 

ASM requires knowledge of the Java bytecode format and there aren't many tutorials on it.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.