Posted October 22, 20231 yr Hey all! I asked around on the discord and didn't get any answers over the last couple of days so I'm coming here: I want to, when my item is used in the furnace as a fuel source, run some action on the actual furnace block. I got far enough that I created a handler class that listens for FurnaceFuelBurnTimeEvent however, that doesn't have any ways to get the position or block of the furnace, any suggestions on how I could accomplish this? Running forge 46.0.14 for Minecraft 1.20
October 23, 20231 yr This would not be possible with the event as that event is not sensitive to any specific position. This is primarily because places such as AbstractFurnaceMenu#isFuel doesn't have access to that. Your best bet therefore would be to write 3 mixins, all into AbstractFurnaceBlockEntity that target the 3 usages of ForgeHooks.getBurnTime (that's the method that fires the event). This would give you access to the BlockEntity (self). AbstractFurnaceBlockEntity#getBurnDuration(ItemStack) AbstractFurnaceBlockEntity#isFuel(ItemStack) AbstractFurnaceBlockEntity#canPlaceItem(int, ItemStack) Just note that there are a few problems with this approach, primarily that AbstractFurnaceMenu#isFuel would disregard your changes. But you also have to consider that any mods which utilise ForgeHooks.getBurnTime (and therefore fire the FurnaceFuelBurnTimeEvent), would also not be subject to your changes. Edited October 23, 20231 yr by TurtyWurty Forgot to list the 3 usages
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.