> For the complete documentation index, see [llms.txt](https://dev-wiki.iamthedefender.xyz/bedwars-cosmetics/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev-wiki.iamthedefender.xyz/bedwars-cosmetics/developer-api/api-examples.md).

# API Examples

Examples of how to use the API

#### Editing the Player Data ->

```java
CosmeticsAPI bwcAPI = Cosmetics.getInstance().getApi();
bwcAPI.getSelectedCosmetic(player, CosmeticsType.WoodSkins);
bwcAPI.setSelectedCosmetic(player, CosmeticsType.WoodSkins, "example");
```

**Setting up a custom victory dance ->**

{% code overflow="wrap" %}

```java
public class example extends VictoryDance {
    public ItemStack getItem() {
        return XMaterial.BARRIER.parseItem();
    }

    public String base64() {
        return null;
    }

    public String getIdentifier() {
        return "example";
    }

    public String getDisplayName() {
        return "Example";
    }

    public List<String> getLore() {
        return List.of("&7Select the example victory dance!");
    }

    public int getPrice() {
        return 5000;
    }

    public RarityType getRarity() {
        return RarityType.COMMON;
    }

    public void execute(Player winner) {
        // your code
    }
}
```

{% endcode %}
