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!

Right now, I've created a potion called "Red Wine" that simply gives the player nausea, here is the code :

Quote

public class RegistryHandler {

       public static final DeferredRegister<Potion> POTIONS = DeferredRegister.create(ForgeRegistries.POTION_TYPES, OfWineAndCheese.MODID);

       //Init function

       public static final RegistryObject<Potion> RED_WINE = POTIONS.register("red_wine", () -> new Potion(new EffectInstance(Effects.CONFUSION.getEffect(), 600, 0)));

}

My potion appears correctly in the ItemGroup.TAB_BREWING with it's name (json and all that). Now, I would like for this potion to use a texture other than the "default" one. How could I achieve that? I searched the internet, but I only found tutorial on how to create effects. I also looked at the Potion class (obviously) and I did not see anything relating to texture or whatnot.

Thanks in advance.

i'm not sure if this will work but, vanilla calculates the Potion Color in PotionUtils.getColor this way is registered in ItemColors
the idea is now you subscribe to ColorHandlerEvent.Item and remove there the ItemColor for the PotionItem, SplashPotionItem and the
LingeringPotionItem then add a custom ItemColor for the these Items

Note: you need Reflection or an AT to remove the ItemColors for the Items

Thank you for your answer, but what's an AT?

To start, if I'm not utterly wrong, this is how I register my custom model :

https://wtools.io/paste-code/b9LW

For the tintidex, I precise it in the .json I guess ? Also, I'm going to appear dumb, but when you speak of overriding both methods, what methods are you speaking about ? Here's my code :

https://wtools.io/paste-code/b9LY

Thanks.

 

Thank you for the answers! Now I'm going to try and make it work.

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.