API Examples

Examples of how to use the API

Editing the Player Data ->

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

Setting up a custom victory dance ->

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
    }
}

Last updated