Posted April 8, 20205 yr New to modding, I'm trying to make a mod to play with friends to add more content in the game. Notably, I'd want to change food items' saturation value and make them unstackable. To do what I want, I need to be able to change the item properties of existing items, however I haven't figured out how to get an item from the game's registries or using ResourceLocation in order to change its properties.
April 9, 20205 yr Author Thanks a lot, at least now I'm able to get an item. I knew it would be just as easy but still couldn't get my head around it. However now I'm hard stuck at changing the properties of said item. If anyone knows a way to either change individual items' properties or an entire classe's (Food especially) that would help tremendously. Edited April 9, 20205 yr by QcDiablo
April 9, 20205 yr Author Wow, I didn't knew about reflection before but it works like a charm! Works flawlessly now, thank you very much.
April 20, 20205 yr On 4/9/2020 at 9:17 AM, diesieben07 said: These values are stored in the Food class, instances of which are stored in the Foods class. You can use reflection to change the stauration values inside them. Set Item#maxStackSize using reflection. I’m trying to do something similar, but I’m even more new to all of this... what do you mean by reflection? Could you give an example please?
April 20, 20205 yr 16 minutes ago, Ekksvar said: what do you mean by reflection? Reflection is a Java feature we do not teach Java here, Google it. Edited April 20, 20205 yr by Animefan8888 VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
April 20, 20205 yr Yeah sorry I realized that just a minute or two ago and was about to delete my comment, my mind blanked and I completely forgot that
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.