API Examples
Applying Skins to Items
Section titled “Applying Skins to Items”GrantService service = api.getGrantService;
service.setActiveSkin(player.getUuid(), item_material, skinId);Removing skins from items
Section titled “Removing skins from items”It’s as simple as doing:
GrantService service = api.getGrantService;
service.setActiveSkin(player.getUuid(), item_material, null);It may cause confusion that setting null unsets the skin, so be careful
Getting the active skin from an item
Section titled “Getting the active skin from an item”GrantService service = api.getGrantServiceSkinService sService = api.getSkinService
Optional<String> oSkinId = service.getActiveSkin(player.getUuid(), item_material)if (skinId.isPresent()) { // If it isn't present it means it doesn't have an active skin Skin skin; Optional<Skin> oSkin = sService.getSkin(skinId) if (oSkin.isPresent()) { skin = oSkin.get(); // Your operation with the skin }}Checking if a player has a skin
Section titled “Checking if a player has a skin”GrantService service = api.getGrantService;
boolean hasSkin = service.hasSkin(player.getUuid(), skinId);