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.

[Workaround Found] [1.7.10] Making a Vanilla Item Usable (Like Food)

Featured Replies

Posted

Someone posted here asking for help making Sugar edible, so I thought I'd try to help them; but unfortunately it looks like vanilla breaks things by replacing the player's held item with a copy, which stops the item from being used (you can see a full explanation of the effect here). My code is here.

 

Is there any way around this without resorting to ASM or intercepting packets?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Yeah, his explanation perfectly describes what's happening.  I tried his code, and it does the same on my end.  It does remove the item if it is a single item, but does the replacing when there's more than one of the item.

Someone posted here asking for help making Sugar edible, so I thought I'd try to help them; but unfortunately it looks like vanilla breaks things by replacing the player's held item with a copy, which stops the item from being used (you can see a full explanation of the effect here). My code is here.

 

Is there any way around this without resorting to ASM or intercepting packets?

 

Did you try replacing the held item yourself? Like every player tick check if the held item is sugar and then replace with your own edible sugar item?

 

And the other way is to fully replace the vanilla by removing it from creative tabs, changing recipes to create your version, and ensure that it doesn't generate in chests or get dropped.

 

And yet another way would be to create your own system for eating those items. Like just count if it being used and decrement your own counter field (or NBT on the item stack).

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

Thanks for the advice, jabelar. I decided to add a custom Edible Sugar item and replace all recipes involving Sugar with recipes that output Edible Sugar and/or take either kind of Sugar as input. I also added recipes to convert between regular and Edible Sugar.

 

You can see my implementation of this here. This is the class I used to replace the recipes.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Thanks for the advice, jabelar. I decided to add a custom Edible Sugar item and replace all recipes involving Sugar with recipes that output Edible Sugar and/or take either kind of Sugar as input. I also added recipes to convert between regular and Edible Sugar.

 

You can see my implementation of this here. This is the class I used to replace the recipes.

 

Cool, glad it worked.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.