// Inside *your* plugin or addon
ClothesPlus clothes = (ClothesPlus) Bukkit.getPluginManager().getPlugin("ClothesPlus");
OverlayAPI overlay = clothes.getOverlayAPI();
OverlayAPI
is singleton-style β grab it once and reuse it.
Term | Description |
overlay id | Path relative to |
folder prefix | Everything before the first β/β. Two overlays in the same folder are exclusive (only one). |
duration (ticks) | 20 ticks = 1 second. Pass |
permission |
|
return type | Every mutating call returns |
// 3.1 Simple wear β stays until you unwear or replace the same folder
overlay.wear(player, List.of("hairs/bob", "eyes/green"));
// 3.2 Temporary wear β auto-remove after 60 s (20 * 60 ticks)
overlay.wear(player, List.of("jackets/leather"), 20 * 60)
.thenAccept(ok -> {
if (!ok) player.sendMessage("Sorry, could not add that jacket.");
});
Rules applied automatically
replaces another overlay in the same folder (hairs/β¦
, eyes/β¦
β¦)
accessory overlays (accessories/β¦
) stack up to the limit in config.yml
permissions are checked internally β you donβt need to guard for them
// 4.1 Strip everything
overlay.unwear(player);
// 4.2 Remove specific items only
overlay.unwear(player, List.of("hairs/bob", "eyes/green"));
unwear
also returns a CompletableFuture<Boolean>
so you can .thenAccept(...)
if needed.
// 5.1 Full immutable list
List<String> worn = overlay.getWornOverlays(player);
// 5.2 Quick check (exact match or folder prefix)
if (overlay.isWearing(player, "hats/")) {
player.sendMessage("You already have a hat on!");
}
Mini-game power-up
overlay.wear(player, List.of("hats/crown"), 20 * 15); // 15-second crown
Quest reward
overlay.wear(player, List.of("jackets/king_leather"));
Cleanup on quit / region leave
overlay.unwear(player);
'Cosmetics' GUI β populate your list fromclothes.getSkinManager().getAvailableOverlayPaths()
and drive clicks with overlay.wear(...)
.
All mutating methods resolve to false
when
the overlay id was invalid
accessory limit is exceeded
MineSkin / texture generation failed (logged to console)
Always attach a thenAccept(Boolean ok)
(or similar) if you need to guarantee success.
All wear
/ unwear
calls run the heavy lifting asynchronously.
You may call them from the main thread without blocking TPS.