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 have two items (not blocks) that I want to be able to be crafted together and swap their metadata values (damage values). The problem is, this relies on two abilities I am not sure exist within the recipe system:

 

One, it must have two output items - neither can be consumed (I am fine with destroying one and recreating it, but I do not want to have to do things like edit the player's inventory directly, as that will lead to bugs).

 

Two, and more ominously, it must be simultaneously metadata-independent (works for every combination of values), yet still determine the outputs from said metadata values. This may seem like a simple problem, solvable with a two-layer for loop, but seeing as each item can have metadata up to the limit - 65535 - I do not want to add 4 billion recipes to the game.

 

How would I accomplish this, or is it impossible?

  • Author

I would need someone to teach me how to do that.

I assume you're using eclipse. In your project explorer right-click, select new->Class. Under Interfaces add IRecipe. That will create a class for you. Then you  can register it with GameRegistry.addRecipe(new YourRecipe()); The method names in IRecipe are pretty self-explanatory.

Every other time I have seen someone mention implementing IRecipe, they actually meant writing my own version. That is why I thought this was harder than it is.

Also, how to modify the metadata of (and not consume) the other item?

I'm betting you're after Item.getContainerItemForItemStack(ItemStack). not sure if that's the exact name but you just return the corresponding itemstack

I think its my java of the variables.

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.