This isn't nessesarily a bug but I would assume it a bug.
Summery: If you hit a creaking with an axe or sword, the durability will decrease although this mob can't get damage by hitting it.
How to Reproduce:
Open Minecraft 24w40a.
Locate a Pale Garden biome and look for one of the Creakings.
Switch to Survival mode.
Get an axe or sword, then hit the creaking.
Observe the durability decrease while the creaking does not get any damages.
Thank you for your report!
After consideration, the issue is being closed as Working as Intended.
Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History – Snapshot Version History – The official Minecraft feedback site
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki