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

I'm looking at starting a new mod with new potions and potion effects.  From what I can tell in 1.11.2, the potion registry is private and you are unable to register directly to it. In researching around, I've found PotionCore, awesome to all those that post their mod's code, on github that basically shows creating an entire extended potion system to support the new potions/potion effects.

 

I should be able to follow the example and get my project working, but I was wondering IF it was necessary to do, or am I missing some way to register new potions, potiontypes, etc.... without having to create an entire support structure for it.....also, does anyone know why this is the direction Forge went with the potion registry (some older examples seem to indicate you could register directly).

 

Thanks,

Tony

 

 

  • Author

 

I could easily be wrong (am most of the time), but scanning through and trying a lit bit, I came to the following...

 

( I deleted the code I was actually trying)...  but summarizing...I was trying to register the mod potiontype and mod potion in a similar fashion as in  the Potion.registerPotions, and PotionType.registerPotionTypes was causing errors.... Registries are marked final and Potion constructor is marked private....I did not simply go to the GameRegistry.register().

 

Looks like the PotionCore code uses the basic framework of the classes, but then relies on trapping events and checking to see if instanceof is modded potion, then implements it's code, rather than using the built in system to have it call the potioneffect,etc...

 

It seems using the built in system would be better if possible. I can play around and see if I can get it to work by registering a ModPotionType, ModPotion, ModPotionEffect straight to the GameRegistry and see if that automatically takes care of implementing the events for me, just wasn't assuming it would, which is why I was trying to look at how the vanilla potions were created and handled.

  • Author

I just think I need to pay attention better to where Forge takes over from MC. Mimicing the MC method wouldn't work now that I think about it.  Difficult to think through sometimes when not able to focus on this for more than a few minutes at a time during the day.

 

Thanks,

 

Tony

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.