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

I'm trying to create a custom anvil recipe, to make so when you combine two items you get a new one (kinda like the pre 1.20 smithing table recipe system, but for the anvil). So I was curious to see if there is a way to make the recipe like usual, with a json file specifying the recipe type.

Apparently there's currently no way of doing this (at least in vanilla Minecraft), so I'm wondering how can you create such recipes? Is there a custom forge recipe type that you can use? Or you have to rely on the AnvilUpdateEvent only?

Edited by JimiIT92
Found out that mixins doesn't actually works for this case, so the event is left

Don't blame me if i always ask for your help. I just want to learn to be better :)

Quote

Apparently there's currently no way of doing this (at least in vanilla Minecraft), so I'm wondering how can you create such recipes?

Correct there are no recipes for the anvil. The logic is hardwired, see AnvilMenu.createResult()

Quote

Is there a custom forge recipe type that you can use? Or you have to rely on the AnvilUpdateEvent only?

Forge does not have one. I guess you could try to implement this yourself?

You would need a RecipeSerializer that lets you parse and load recipes for the Anvil using a new RecipeType.

You would then check these recipes in the AnvilUpdateEvent using RecipeManager.getRecipeFor().

To get the recipe manager: player.level -> ServerLevel -> Server -> RecipeManager

 

The devil is always in the detail. There is probably a reason why Mojang or Forge haven't already done this? 🙂

Edited by warjort

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

  • Author

Yeah, maybe that would break things... Will try at some point to do so to see if I can add this. Meanwhile what I've tried is to listen to the event, check the ingredients and if they matches two items for a custom recipe I set the output of the event to the desired result. However for some reason I see the output but can't pick up from the anvil

Don't blame me if i always ask for your help. I just want to learn to be better :)

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.