Choonster Posted October 25, 2015 Share Posted October 25, 2015 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? Quote 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. Link to comment Share on other sites More sharing options...
darthvader45 Posted October 25, 2015 Share Posted October 25, 2015 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. Quote Link to comment Share on other sites More sharing options...
jabelar Posted October 26, 2015 Share Posted October 26, 2015 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). Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
Choonster Posted October 26, 2015 Author Share Posted October 26, 2015 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. Quote 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. Link to comment Share on other sites More sharing options...
jabelar Posted October 26, 2015 Share Posted October 26, 2015 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. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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.