The only capes that can be obtained on one's own, so far, in Java Edition are the migrator cape, which comes from migrating a Mojang account to a Microsoft account, and the vanilla cape, which comes from owning both Java Edition and Bedrock Edition in the same Microsoft account prior to June 6, 2022.