Jump to content

[1.19.2] The Item can't merge into one slot.


Wen Li

Recommended Posts

When player killed mob, my mod will send some item into inventory of player directly. But I find that sometimes the same type items can't merge into one slot. But after put them in mainhand, these items can be merge into one slot. The item be sent is mod custom item, and they have some HoverText added by mod. How to solve it?

Link to comment
Share on other sites

Solved! I found that when the items in your hand, the items would be sent a mod's nbt tag automatically. That caused one slot item had tag, and another slot not. So, the solution is: Before sending items to player, use itemstack.getOrCreateTagElement method to add tag to items firstly. And then all the items have same tags, they can be merged into one slot!

Link to comment
Share on other sites

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.