Posted May 10, 20205 yr 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 May 11, 20205 yr by izofar
May 10, 20205 yr I would recommend looking at BrewingRecipeRegistry#addRecipe. Edited May 10, 20205 yr by ChampionAsh5357
May 10, 20205 yr 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 May 11, 20205 yr by izofar
May 11, 20205 yr 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.
May 11, 20205 yr 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!
May 11, 20205 yr 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.