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.

[1.11.2][2315][Custom inventory via Capabilityes]New ItemStack returns 0xtile.air

Featured Replies

Posted

Hi.

I was making an extension of player inventory doing it Capabilities style.

On thing i found bizzare that every time i try to make a new ItemStack it goes 0xtile.air, and for some reason it trashes that the item stack was made not from Air but from a custom item

Capa Provider - the 54 line

I was trying to make it pretty and tested some probability behaviors trowing the creation of the ItemStack outside of the main class.

But every time i get a itemstack 0xTile.air , but with a correct item.

screenshot

Does it suppose to be this way? Or i have to remake the saving of the NBT to confront this illogical behavior, and also an itemList, because i find this odd.Or maybe I'm just a dum-dum.

But srsly it needs to be some thing like 1xItem.%YOURNAME or etc...

Please advice, i'm a bit tired slamming this problem for the third week.

Quote

i get a itemstack 0xTile.air , but with a correct item.

What does this mean?

Where are you finding the ItemStack as 0xtile.air? Ignoring what you see in the code, what happens in the gameplay that is not what you expect?

Quote

Does it suppose to be this way? Or i have to remake the saving of the NBT to confront this illogical behavior

NBT is nothing to do with creating items, it's only about storing data when the world is saved.

Edited by Jay Avery

  • Author
2 minutes ago, Jay Avery said:

NBT is nothing to do with creating items, it's only about storing data when the world is saved.

Yes i know ,thank you.

I actually found it in the debug while trying to figure out what's happening

img

And , it's a bit bizzare. Because further while NBT try's to save the list of the items, it just writes minecraft:air ignoring that the itemstack item is diffirent.

I tryes the default implementation and a custom with just .writeNBT from the itemstack methods, and it's the same, it writes minecraft:air all the time no matter the item.

  • 3 months later...

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.