diff --git a/eco-core/core-nms/v1_21/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_21/DisplayName.kt b/eco-core/core-nms/v1_21/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_21/DisplayName.kt index 3ec0281e..c78fd941 100644 --- a/eco-core/core-nms/v1_21/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_21/DisplayName.kt +++ b/eco-core/core-nms/v1_21/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_21/DisplayName.kt @@ -43,15 +43,13 @@ class DisplayName : DisplayNameProxy { val nmsComponent = displayName.toNMS() val nmsEntity = entity.handle - nmsEntity.isCustomNameVisible - val entityData = SynchedEntityData.Builder(nmsEntity).build() - - entityData.set(displayNameAccessor, Optional.of(nmsComponent), true) - entityData.set(customNameVisibleAccessor, visible, true) val packet = ClientboundSetEntityDataPacket( nmsEntity.id, - entityData.packDirty() ?: throw IllegalStateException("No packed entity data") + listOf( + SynchedEntityData.DataValue.create(displayNameAccessor, Optional.of(nmsComponent)), + SynchedEntityData.DataValue.create(customNameVisibleAccessor, visible) + ) ) player.sendPacket(Packet(packet))