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

  • Author
4 minutes ago, diesieben07 said:

InventoryPlayer is the player inventory, you can access it via EntityPlayer::inventory. Then just call setInventorySlotContents to change the contents of a slot.

Could you write me example of this code? I'm new to modding

  • Author
4 minutes ago, diesieben07 said:

If you need an example of how to access a field and how to call a method you are not "new to modding", you are new to Java, in which case you need to go and learn Java before making a mod.

I was not sure that I would succeed and therefore asked for help. But this code works !

((EntityPlayer) entity).inventory.setInventorySlotContents(5, null);

Thank you!

Which version of Minecraft are you using?

 

In 1.11+, ItemStacks can no longer be null; the default value is now the empty ItemStack (ItemStack#isEmpty). The ItemStack.EMPTY field contains an ItemStack that's always empty.

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.

  • Author
Just now, Choonster said:

Which version of Minecraft are you using?

 

In 1.11+, ItemStacks can no longer be null; the default value is now the empty ItemStack (ItemStack#isEmpty). The ItemStack.EMPTY field contains an ItemStack that's always empty.

1.7.10

  • Guest locked this topic
Guest
This topic is now closed to further replies.

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.