Jump to content

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


Recommended Posts

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.

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

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