Familiar ring fails to send packet: "Cannot invoke "net.minecraft.nbt.Tag.m_7060_()" because "p_128370_" is null"
mosharky opened this issue ยท 5 comments
Describe the bug
Tested with a Parrot, the Familiar Ring fails to send an NBT packet thing to nearby players. Just having the ring in your hand causes the packet error, not actually placing the parrot.
To Reproduce
Steps to reproduce the behavior:
- Have a Familiar Ring (with a Parrot, possibly happens with others)
- Equip it onto a slot in the hotbar
- Exit your inventory and switch to that slot
- Everyone around you gets kicked due to an error in sending the packet
System (please complete the following information):
- Occultism Version: 1.20.1-1.80.8
- OS: Windows
- Minecraft Version: 1.20
- Modpack Link and Version, or list of mods: https://gist.github.com/mosharky/0860ebea76385b21dfeeaf51e5e4013a
Additional context
The error from the latest.log:
[20Jun2023 16:58:36.274] [Netty Epoll Server IO #1/ERROR] [net.minecraft.network.PacketEncoder/]: Error receiving packet 85
java.lang.NullPointerException: Cannot invoke "net.minecraft.nbt.Tag.m_7060_()" because "p_128370_" is null
at net.minecraft.nbt.CompoundTag.m_128368_(CompoundTag.java:456) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.nbt.CompoundTag.m_6434_(CompoundTag.java:135) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.nbt.NbtIo.m_128950_(NbtIo.java:139) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.nbt.NbtIo.m_128941_(NbtIo.java:108) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.network.FriendlyByteBuf.m_130079_(FriendlyByteBuf.java:588) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.network.FriendlyByteBuf.writeItemStack(FriendlyByteBuf.java:646) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.network.FriendlyByteBuf.m_130055_(FriendlyByteBuf.java:625) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket.m_5779_(ClientboundSetEquipmentPacket.java:49) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:45) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:14) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.82.Final.jar%2381!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[netty-codec-4.1.82.Final.jar%2381!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[netty-codec-4.1.82.Final.jar%2381!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:790) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:758) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:808) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:306) ~[netty-transport-4.1.82.Final.jar%2385!/:4.1.82.Final]
at net.minecraft.network.Connection.m_243087_(Connection.java:216) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at net.minecraft.network.Connection.lambda$sendPacket$8(Connection.java:205) ~[server-1.20-20230608.053357-srg.jar%23279!/:?]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.82.Final.jar%2382!/:4.1.82.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.82.Final.jar%2382!/:4.1.82.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.82.Final.jar%2382!/:4.1.82.Final]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:403) ~[netty-transport-classes-epoll-4.1.82.Final.jar%2386!/:4.1.82.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.82.Final.jar%2382!/:4.1.82.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.82.Final.jar%2382!/:4.1.82.Final]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
[20Jun2023 16:58:36.327] [Server thread/INFO] [net.minecraft.server.network.ServerGamePacketListenerImpl/]: ThinDiamond3172 lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException: Cannot invoke "net.minecraft.nbt.Tag.m_7060_()" because "p_128370_" is null
[20Jun2023 16:58:36.327] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: ThinDiamond3172 left the game
I'm not sure how to test it just by myself, but I would be open to testing it if I knew how to. I wouldn't want to drag a friend along my journey to finding the cause. I wouldn't be surprised if Domestication Innovation had something to do with the error though.
My curios version is 5.2.0-beta.3 as well
@mosharky Can you reproduce this with just occultism + dependencies?
If I run it in my test environment on a server with two players I can follow your steps but get no crash nor any error logs on the server or client.
It could be that this is caused by another mod (could be curios itself which I use for the ring, although 5.2.0-beta.3 works fine for me - which version do you have so I can try it with that?), mods that do network stuff can actually cause errors like that for other mods if not careful
Considering this seems not to be a common/ongoing problem it might be an issue of a specific mod combination or already fixed. Closing this as stale, if it pops up again please ping me or create a new issue
@mosharky did you find out what the issue was?