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

Hi! I'm really new to modding. I've been trying new things and I was wanting to add new recipes to the brewing stand. I've added in a recipe using this code: 

public void init(FMLCommonSetupEvent event) {
		try {
			Class clazz = net.minecraft.potion.PotionBrewing.class;
			Method mth = ObfuscationReflectionHelper.findMethod(clazz, "func_193357_a", Potion.class, Item.class, Potion.class);
			mth.invoke(null, Potions.EMPTY, BismuthChunkItem.block, MoltenBismuthBottle1Item.block);
			// To add more recipes, you can copy the line above, for ex.
			// mth.invoke(null, potion2, item2, potion3);
		} catch (Throwable e) {
			System.err.println("ERROR: " + e); // You can change this part
		}
	}

Now, I'm not sure if this is exactly taboo of me or telling of my newbie status to modding, but I'm using MCreator for creating this mod, and this code wasn't actually written by me, it was copied from a forum post for MCreator modding. Now, I actually have a decent amount of experience with coding, with Javascipt, Python, C, C#, and a C variant called GML. I've never used Java outside of programming mods for Minecraft, and like I said I'm new to that.

This code raises no errors, and builds correctly and runs, but the problem is that I can't actually put the Bismuth Chunk item into the ingredient slot in the brewing stand GUI, nor can I put an empty glass bottle into the potion slot in the brewing stand GUI. I've tried replacing "Potions.EMPTY" with "Items.GLASS_BOTTLE", but neither work.

Having next to no experience coding these things, I don't know where to go from here.

I'd really appreciate any help I can get with this.

MCreator is not supported on this forum. It is completely recommend that you take the time to learn java properly before coding as it is a semi-variation on C languages.

To answer your question though, Potion recipes should be registered through BrewingRecipeRegistry.

  • Guest locked this topic
Guest
This topic is now closed to further replies.

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.