Problem of "ItemStringReader" and "insertStack()" #3968
Unanswered
sky880319
asked this question in
Mod Dev Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I have a problem with version 1.21 (server) when parsing a string to
ItemStack
and inserting the item into the player slot.Here is my code:
If
this.itemString = "minecraft:enchanted_book[minecraft:stored_enchantments={mending:1}]"
, an exception will occurs after executedserverPlayerEntity.getInventory().insertStack()
, and player will get a disconnect message as follows:Internal Exception: io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:container_set_slot'
.But
this.itemString = "minecraft:potion[minecraft:potion_contents={potion:healing}]"
can work.I had check server log. and I got this call stack:
I used the following code to do the same work, that work fine in version 1.20.6:
Please give me some suggestion to fix this mistake, thanks a lot!!!
Beta Was this translation helpful? Give feedback.
All reactions