Services Reference

Comprehensive guide detailing the individual service interfaces exposed by ShyamDuelsAPI.

Overview of Services

Each service interface manages a specific aspect of the plugin (matchmaking, players, statistics, structures). Resolve a service instance from your resolved API entry point:

javaShyamDuelsAPI api = ShyamDuelsProvider.require();
DuelService duelService = api.duels();
StatsService statsService = api.stats();

DuelService

Interface: com.shyamstudio.shyamduels.api.duel.DuelService
Manages active duel instances, invitations, and match structures:

Method Signature Returns Description
isInDuel(Player player) boolean Returns true if the player is currently inside a duel.
getDuel(Player player) Duel Retrieves the player's current active Duel model, or null.
getOpponent(Player player) Player Gets the player's active opponent (1v1 duels), or null.
startDuel(Player p1, Player p2, Kit kit, int rounds) void Immediately starts a duel between two players in a claimed arena.
forceEnd(Duel duel) void Immediately terminates the duel instance and teleports players back to lobby.
sendInvite(Player sender, Player target, Kit kit, int rounds) void Sends a duel invite challenge from sender to target.

StatsService

Interface: com.shyamstudio.shyamduels.api.stats.StatsService
Fetches and updates player ELO ratings, kills, deaths, winstreaks, and ranks:

Method Signature Returns Description
getStats(Player player) PlayerStats Gets the player's cached statistics.
getStats(UUID uuid) CompletableFuture<PlayerStats> Asynchronously queries player statistics from the database pool (supports offline players).
saveStats(PlayerStats stats) CompletableFuture<Void> Saves modifications back to the SQLite or MySQL database pools.

ArenaService

Interface: com.shyamstudio.shyamduels.api.arena.ArenaService
Coordinates FAWE reset states and lists active arena environments:

Method Signature Returns Description
getArena(String name) Arena Resolves an Arena model by its case-insensitive name.
getArenas() Collection<Arena> Returns a list of all registered arenas.
resetArena(Arena arena) void Force-queues an immediate schematic reset paste on the arena.

KitService

Interface: com.shyamstudio.shyamduels.api.kit.KitService
Manages kit configurations and whitelist setups:

Method Signature Returns Description
getKit(String name) Kit Resolves a kit configuration template by name.
getKits() Collection<Kit> Returns all registered kit templates.

PartyService

Interface: com.shyamstudio.shyamduels.api.party.PartyService
Tracks active parties, member indices, and team divisions:

Method Signature Returns Description
getParty(Player player) Party Retrieves the player's active Party, or null.
isInParty(Player player) boolean Returns true if the player is currently inside a party structure.

FriendsService

Interface: com.shyamstudio.shyamduels.api.friend.FriendsService
Manages friend requests and friend list states:

Method Signature Returns Description
getFriends(Player player) List<UUID> Gets a list of player UUIDs on the target player's friends list.
isFriend(Player p1, Player p2) boolean Returns true if the players are friends.

QueueService

Interface: com.shyamstudio.shyamduels.api.queue.QueueService
Manages ranked/unranked matchmaking queues for solo players and parties:

Key MethodsDescription
addPlayer(player, kit, mode)Adds a player to a kit queue.
removePlayer(player)Removes a player from all queues.
isQueued(player)Returns whether the player is in any queue.
getQueueSize(kitName, mode)Players waiting in a specific queue.
addParty(party, kit, mode)Queues an entire party together.

FFAService

Interface: com.shyamstudio.shyamduels.api.ffa.FFAService
Controls FFA join/leave, arena state, and resets:

Key MethodsDescription
joinFFA(player, arena)Teleports a player into an FFA arena.
leaveFFA(player)Removes a player from FFA.
getPlayerArena(player)Returns the arena the player is in, or null.
resetArena(arena)Triggers an FFA map reset.

SpectatorService

Interface: com.shyamstudio.shyamduels.api.spectate.SpectatorService

Key MethodsDescription
joinSpectate(spectator, target)Starts spectating a player's duel.
leaveSpectate(spectator)Stops spectating.
getActiveDuels()Lists all duels that can be spectated.

SettingsService, PlaceholderService, CommandService

Additional core services on ShyamDuelsAPI:

Optional Services

Available when the corresponding module is enabled: