Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

 

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.

  • Author

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?

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.

  • Author

Thank you for the answers, I will try looking into ASM, otherwise my team will use spigot cauldron to develop the mod.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.