Jump to content

Recommended Posts

Posted

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.

Posted (edited)

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 by QcDiablo
  • 2 weeks later...
Posted
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?

Posted (edited)
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 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.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.