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

Currently, I am using reflection to call Potions.addMix I want to be able to use the honey bottle as a base potion like I would water, awkward potions, etc. However, the HoneyBottleItem does not inherit from Potion. It seems that registered Potions have an item automatically generated for them, which I don't want because honey bottles already have an associated item. How can I, given a registered Potion HONEY, override it's item to be the honey bottle, so that I may use Potions.addMix(HONEY, ...)? Or, is there a better way to achieve this?

 

Edit: While I considered a custom class that extends the necessary superclasses, the BeehiveBlock class has a native method that returns the HoneyBottleItem during the appropriate event. This would cause trouble for me for I would have to create a custom beehive class then modify world-gen. I hope there's another way.

Edited by izofar

  • Author
6 hours ago, ChampionAsh5357 said:

I would recommend looking at BrewingRecipeRegistry#addRecipe.

Thanks! This seems to be supposed to do what I want, though when I call

BrewingRecipeRegistry.addRecipe(
	Ingredient.fromItems(Items.field_226638_pX_), 		//Honey Bottle Item (retrived from source)
	Ingredient.fromItems(Items.FERMENTED_SPIDER_EYE), 
	PotionUtils.addPotionToItemStack(new ItemStack(Items.SPLASH_POTION), Potions.WEAKNESS)

 

in-game, I still can't place honey bottles in the potion slot. Could this have to do with honey bottles not inheriting from minecraft.item.PotionItem?

 

To make sure, I have indeed checked that the method containing the above code is called with the rest of the registers (And with a debug output that shows up in the console).

Edited by izofar

No, I replicated the same process and it works fine. The item that you chose may not be the honey bottle, or you're call of the registry is not on both the client and server.

  • Author
13 minutes ago, ChampionAsh5357 said:

No, I replicated the same process and it works fine. The item that you chose may not be the honey bottle, or you're call of the registry is not on both the client and server.

I see, in switching the honey bottle to Items.IRON_INGOT, it seems to work fine. This is interesting since in net.minecraft.item.Items, I read:

public static final Item field_226638_pX_ = register("honey_bottle", new HoneyBottleItem((new Item.Properties())
		.containerItem(GLASS_BOTTLE)
		.food(Foods.field_226604_w_)
		.group(ItemGroup.FOOD)
		.maxStackSize(16)));

Which appears to be the honey bottle. I will have to investigate this further, but this seemed to narrow down the issue, thank you!

  • Author

[FIXED] Silly me...

 

... when testing the code I last posted, I was attempting to place a stack of honey bottles instead of a single honey bottle...

 

Otherwise, it works fine. Thank you to all who replied.

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.