NullPointerException in ClientboundUpdateAttributesPacket causes server crash
Description: My Minecraft server (version 1.21.1, Paper) crashes when certain mobs attempt to update player attributes. The crash occurs during the world ticking process, and the error points to a NullPointerException in the ClientboundUpdateAttributesPacket class. This issue appears to be related to entities that interact with or modify player attributes.
Steps to Reproduce: Start the server with the following custom mobs:
skr_barebone skr_berserker skr_skirmisher skr_arbalist skr_ranger skr_witherbone zc_runner zc_spitter zc_scavenger zc_crusher zc_walker zc_impaler Play in the specified world ("survivallands") with these mobs spawning under their respective conditions (mostly at night, inside or outside).
The server crashes when player attributes are being updated by one of these mobs.
Expected Behavior: The server should not crash, and player attributes should update correctly during entity interaction.
Actual Behavior: The server crashes with a NullPointerException related to ClientboundUpdateAttributesPacket.
// You're mean.
Time: 2024-10-22 12:38:21 Description: Exception ticking world
java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectArrayList.get(int)" because "this.wrapped" is null at it.unimi.dsi.fastutil.objects.ObjectOpenHashSet$SetIterator.next(ObjectOpenHashSet.java:575) at net.minecraft.network.protocol.game.ClientboundUpdateAttributesPacket.(ClientboundUpdateAttributesPacket.java:34) at net.minecraft.server.level.ServerEntity.sendDirtyEntityData(ServerEntity.java:426) at net.minecraft.server.level.ServerEntity.sendChanges(ServerEntity.java:239) at net.minecraft.server.level.ChunkMap.newTrackerTick(ChunkMap.java:931) at net.minecraft.server.level.ChunkMap.tick(ChunkMap.java:952)
Plugins/Mods In Use: Citizens MythicMobs ModelEngine Lands BetterDialogues And others listed in the crash log Additional Information: Server RAM: 64GB (57GB used) Java Version: OpenJDK 22.0.2 CPU: AMD Ryzen 7 PRO 8700GE with Radeon 780M Graphics