ProtocolLib

3M Downloads

EntityMetadata doesn't work in 1.19.3

karu1231 opened this issue · 4 comments

commented
  • This issue is not solved in a development build

Describe the bug
When I try to rewrite EntityMetadata Packet in 1.19.3 with onPacketSending, I get an error that Datawatcher is unrecognized.

To Reproduce
Steps to reproduce the behavior:

  1. Listen for EntityMetadata packets using PacketAdapter.
  2. To extract data from the packet, read number 0 of WatchableCollectionModifier.
  3. See error

Expected behavior
Manipulate EntityMeta packet data. (Note that this is an error that appeared when the code that worked in 1.18.1 was brought to 1.19.3, but worked fine in 1.18.1.)

Screenshots
image
image

commented

You need to update your code to the new metadata system of Minecraft. WrappedWatchableObject has been replaced with WrappedDataValue. There is also a modifier for this. I think it is getWrappedDataValueLists() or similar

commented

Thank you for your reply.
I changed it to WrappedDataValue and tried to change the displayName, but I get the error again.

image
スクリーンショット (1301)

commented

You need to provide the unwrapped handle in the constructor of WrappedDataValue. So in your case Optional.of(WrappedChatComponent.fromText(name).getHandle())

commented

Thanks for your advice, it is very helpful.
I have successfully reached the program I was looking for. Thank you very much.
Since it seems to have worked successfully, I will close this Issue.