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

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.

  • 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 by QcDiablo

  • Author

Wow, I didn't knew about reflection before but it works like a charm!

Works flawlessly now, thank you very much.

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

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.

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.

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.