Files
website/wiki/mymc-lib/index.html
2025-06-17 01:22:30 -04:00

577 lines
34 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MyMCLib Library Documentation</title>
<link rel="icon" href="https://minecraft.wiki/images/Favicon.png" type="image/png">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700;900&display=swap" rel="stylesheet">
<link href="https://my-mc.link/css/style_min.css?p=5" rel="stylesheet">
<link href="https://my-mc.link/favicon.ico" rel="icon" type="image/x-icon">
<!-- Prism.js for syntax highlighting -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-okaidia.min.css" rel="stylesheet">
<style>
.code-block-wrapper {
position: relative;
margin-bottom: 1rem;
}
.copy-button {
position: absolute;
top: 0.5rem;
right: 0.5rem;
background: #2d3748;
color: #e2e8f0;
border: none;
padding: 0.5rem;
border-radius: 0.25rem;
cursor: pointer;
font-size: 0.875rem;
transition: background 0.2s;
}
.copy-button:hover {
background: #4a5568;
}
.copy-button.copied {
background: #2f855a;
}
pre[class*="language-"] {
margin: 0;
padding: 1rem;
border-radius: 0.5rem;
position: relative;
}
/* Table of Contents Styles */
.toc {
background: rgba(17, 24, 39, 0.8);
backdrop-filter: blur(10px);
border-radius: 12px;
padding: 1.5rem;
margin: 2rem auto;
max-width: 800px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.toc h2 {
font-family: 'minecraft-font', sans-serif;
font-size: 1.75rem;
text-align: center;
background: linear-gradient(to right, #14b8a6, #3b82f6);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
margin-bottom: 1.5rem;
}
.toc ul {
list-style: none;
padding: 0;
}
.toc li {
margin: 0.75rem 0;
}
.toc a {
color: #d1d5db;
text-decoration: none;
font-size: 1.125rem;
font-weight: 500;
transition: color 0.3s ease, transform 0.3s ease;
display: block;
padding: 0.5rem 1rem;
border-radius: 8px;
}
.toc a:hover {
color: #14b8a6;
transform: translateX(10px);
background: rgba(255, 255, 255, 0.05);
}
@media (max-width: 640px) {
.toc {
padding: 1rem;
margin: 1rem;
}
.toc h2 {
font-size: 1.5rem;
}
.toc a {
font-size: 1rem;
}
}
</style>
</head>
<body>
<!-- Particle Effects -->
<div class="particle" style="left: 10%; top: 20%; animation-delay: 0s;"></div>
<div class="particle large" style="left: 30%; top: 50%; animation-delay: 2s;"></div>
<div class="particle" style="left: 50%; top: 30%; animation-delay: 4s;"></div>
<div class="particle large" style="left: 70%; top: 60%; animation-delay: 6s;"></div>
<div class="particle" style="left: 20%; top: 80%; animation-delay: 8s;"></div>
<header class="header-bg py-16 text-center relative z-10">
<div class="header-content flex items-center justify-between max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div>
<h1 class="text-5xl minecraft-font bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500">
<a href="https://info.my-mc.link/"> MyMCLib Library Documentation</a></h1>
<p class="text-lg mt-4 opacity-90 tracking-wide font-medium">A JavaScript library for interacting with the My-MC.Link API</p>
</div>
<a href="https://my-mc.link" class="btn-minecraft text-base self-center" target="_blank">Home</a>
</div>
</header>
<!-- Table of Contents -->
<nav class="toc">
<h2>Table of Contents</h2>
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#code-examples">Code Examples</a></li>
<li><a href="#getting-server-time">Getting Server Time</a></li>
<li><a href="#getting-server-statistics">Getting Server Statistics</a></li>
<li><a href="#getting-server-logs">Getting Server Logs</a></li>
<li><a href="#starting-the-minecraft-server">Starting the Minecraft Server</a></li>
<li><a href="#stopping-the-minecraft-server">Stopping the Minecraft Server</a></li>
<li><a href="#restarting-the-minecraft-server">Restarting the Minecraft Server</a></li>
<li><a href="#creating-a-custom-link">Creating a Custom Link</a></li>
<li><a href="#deleting-a-custom-link">Deleting a Custom Link</a></li>
<li><a href="#creating-an-sftp-link">Creating an SFTP Link</a></li>
<li><a href="#deleting-an-sftp-link">Deleting an SFTP Link</a></li>
<li><a href="#getting-connection-hash">Getting Connection Hash</a></li>
<li><a href="#getting-sftp-connection-hash">Getting SFTP Connection Hash</a></li>
<li><a href="#getting-online-players">Getting Online Players</a></li>
<li><a href="#getting-servers-website-url">Getting Server's Website URL</a></li>
<li><a href="#getting-servers-map-url">Getting Server's Map URL</a></li>
<li><a href="#banning-a-player">Banning a Player</a></li>
<li><a href="#unbanning-a-player">Unbanning a Player</a></li>
<li><a href="#sending-a-message-to-all-players">Sending a Message to All Players</a></li>
<li><a href="#sending-a-private-message-to-a-player">Sending a Private Message to a Player</a></li>
<li><a href="#executing-a-command-in-server-console">Executing a Command in Server Console</a></li>
<li><a href="#giving-an-item-to-a-player">Giving an Item to a Player</a></li>
<li><a href="#installing-a-mod-by-id">Installing a Mod by ID</a></li>
<li><a href="#uninstalling-a-mod-by-id">Uninstalling a Mod by ID</a></li>
<li><a href="#retrieving-a-list-of-installed-mods">Retrieving a List of Installed Mods</a></li>
<li><a href="#api-reference">API Reference</a></li>
<li><a href="#java-client">Java Client</a></li>
<li><a href="#explore-more">Explore More</a></li>
</ul>
</nav>
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16 relative z-10">
<section id="overview" class="section-bg p-8 sm:p-10 mb-12">
<h2 class="text-3xl minecraft-font mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500">
Overview</h2>
<p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed">
The <code class="bg-gray-800 text-teal-400 px-1 rounded">MyMCLib</code> library provides a convenient way to interact with the My-MC.Link API for managing Minecraft servers. It includes methods for performing various actions such as retrieving server information, managing server settings, controlling gameplay, and interacting with players.
</p>
</section>
<section id="installation" class="section-bg p-8 sm:p-10 mb-12">
<h2 class="text-3xl minecraft-font mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500">
Installation</h2>
<p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed">
To use the <code class="bg-gray-800 text-teal-400 px-1 rounded">MyMCLib</code> library in your project, install it via npm:
</p>
<div class="code-block-wrapper">
<pre class="language-bash"><code>npm install mymc-lib</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
<p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed">
<strong>Proper Importing:</strong> To make use of this module, you'll need to either utilize the <code class="bg-gray-800 text-teal-400 px-1 rounded">.mjs</code> extension or incorporate <code class="bg-gray-800 text-teal-400 px-1 rounded">"type": "module"</code> in your <code class="bg-gray-800 text-teal-400 px-1 rounded">package.json</code> file. This ensures compatibility with ECMAScript modules.
</p>
</section>
<section id="usage" class="section-bg p-8 sm:p-10 mb-12">
<h2 class="text-3xl minecraft-font mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500">
Usage</h2>
<p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed">
First, import the library and create an instance with your API token:
</p>
<div class="code-block-wrapper">
<pre class="language-typescript"><code>import MyMCLib from "mymc-lib";
const MyMC = new MyMCLib("your-api-token");
</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
<p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed">
<strong>Example Usage:</strong> Retrieve information about your API key's expiration date.
</p>
<div class="code-block-wrapper">
<pre class="language-typescript"><code>import MyMCLib from "mymc-lib";
// Instantiate MyMCLib with your API token
const MyMC = new MyMCLib("your-api-token");
// Will print information about API key expiration date
let keyData = await MyMC.getTime();
console.log(keyData);
</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
<p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed">
<strong>Output:</strong>
</p>
<div class="code-block-wrapper">
<pre class="language-json"><code>{
success: true,
keyexpireString: 'Tue Apr 15 2025 06:14:59 GMT-0400 (Eastern Daylight Time)',
expireDate: '2025-04-15T10:14:59.000Z',
expireEpoch: 1744712099000
}</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</section>
<section id="code-examples" class="section-bg p-8 sm:p-10 mb-12">
<h2 class="text-3xl minecraft-font mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500">
Code Examples</h2>
<div class="grid grid-cols-1 gap-6">
<!-- 1. Getting Server Time -->
<div id="getting-server-time" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Getting Server Time</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const timeData = await MyMC.getTime();
console.log(timeData);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 2. Getting Server Statistics -->
<div id="getting-server-statistics" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Getting Server Statistics</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const statsData = await MyMC.getStats();
console.log(statsData);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 3. Getting Server Logs -->
<div id="getting-server-logs" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Getting Server Logs</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const logData = await MyMC.getLog();
console.log(logData);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 4. Starting the Minecraft Server -->
<div id="starting-the-minecraft-server" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Starting the Minecraft Server</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const startResult = await MyMC.startServer();
console.log(startResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 5. Stopping the Minecraft Server -->
<div id="stopping-the-minecraft-server" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Stopping the Minecraft Server</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const stopResult = await MyMC.stopServer();
console.log(stopResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 6. Restarting the Minecraft Server -->
<div id="restarting-the-minecraft-server" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Restarting the Minecraft Server</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const restartResult = await MyMC.restartServer();
console.log(restartResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 7. Creating a Custom Link -->
<div id="creating-a-custom-link" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Creating a Custom Link</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const customLinkResult = await MyMC.createMyLink();
console.log(customLinkResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 8. Deleting a Custom Link -->
<div id="deleting-a-custom-link" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Deleting a Custom Link</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const deleteLinkResult = await MyMC.deleteMyLink();
console.log(deleteLinkResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 9. Creating an SFTP Link -->
<div id="creating-an-sftp-link" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Creating an SFTP Link</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const sftpLinkResult = await MyMC.createLinkSFTP();
console.log(sftpLinkResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 10. Deleting an SFTP Link -->
<div id="deleting-an-sftp-link" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Deleting an SFTP Link</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const deleteSftpLinkResult = await MyMC.deleteLinkSFTP();
console.log(deleteSftpLinkResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 11. Getting Connection Hash -->
<div id="getting-connection-hash" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Getting Connection Hash</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const hashData = await MyMC.getConnectionHash();
console.log(hashData);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 12. Getting SFTP Connection Hash -->
<div id="getting-sftp-connection-hash" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Getting SFTP Connection Hash</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const sftpHashData = await MyMC.getConnectionHashSFTP();
console.log(sftpHashData);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 13. Getting Online Players -->
<div id="getting-online-players" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Getting Online Players</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const playersData = await MyMC.getOnlinePlayers();
console.log(playersData);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 14. Getting Server's Website URL -->
<div id="getting-servers-website-url" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Getting Server's Website URL</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const websiteURL = await MyMC.getWebsiteURL();
console.log(websiteURL);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 15. Getting Server's Map URL -->
<div id="getting-servers-map-url" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Getting Server's Map URL</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const mapURL = await MyMC.getMapURL();
console.log(mapURL);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 16. Banning a Player -->
<div id="banning-a-player" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Banning a Player</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const banResult = await MyMC.postBan("username");
console.log(banResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 17. Unbanning a Player -->
<div id="unbanning-a-player" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Unbanning a Player</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const unbanResult = await MyMC.postUnban("username");
console.log(unbanResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 18. Sending a Message to All Players -->
<div id="sending-a-message-to-all-players" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Sending a Message to All Players</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const sayResult = await MyMC.postSay("Hello, everyone!");
console.log(sayResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 19. Sending a Private Message to a Player -->
<div id="sending-a-private-message-to-a-player" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Sending a Private Message to a Player</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const tellResult = await MyMC.postTell("username", "Hey, how are you?");
console.log(tellResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 20. Executing a Command in Server Console -->
<div id="executing-a-command-in-server-console" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Executing a Command in Server Console</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const consoleResult = await MyMC.postConsole("say Hello, world!");
console.log(consoleResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 21. Giving an Item to a Player -->
<div id="giving-an-item-to-a-player" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Giving an Item to a Player</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const giveResult = await MyMC.postGive("username", "item", 1);
console.log(giveResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 22. Installing a Mod by ID -->
<div id="installing-a-mod-by-id" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Installing a Mod by ID</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const modID = "exampleMod123";
const installResult = await MyMC.installMod(modID);
console.log(installResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 23. Uninstalling a Mod by ID -->
<div id="uninstalling-a-mod-by-id" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Uninstalling a Mod by ID</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const modID = "exampleMod123";
const uninstallResult = await MyMC.uninstallMod(modID);
console.log(uninstallResult);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
<!-- 24. Retrieving a List of Installed Mods -->
<div id="retrieving-a-list-of-installed-mods" class="feature-card tilt-card">
<h3 class="text-xl minecraft-font mb-3 text-teal-400">Retrieving a List of Installed Mods</h3>
<div class="code-block-wrapper">
<pre class="language-javascript"><code>const installedMods = await MyMC.getInstalledMods();
console.log(installedMods);</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
</div>
</div>
</section>
<section id="api-reference" class="section-bg p-8 sm:p-10 mb-12">
<h2 class="text-3xl minecraft-font mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500">
API Reference</h2>
<h3 class="text-2xl minecraft-font mb-4 text-teal-400">MyMCLib Class</h3>
<h4 class="text-xl mb-3 text-teal-400">Constructor</h4>
<div class="code-block-wrapper">
<pre class="language-typescript"><code>constructor(token: string)</code></pre>
<button class="copy-button" onclick="copyCode(this)">Copy</button>
</div>
<p class="text-sm opacity-90 leading-relaxed mb-4">Creates an instance of the <code class="bg-gray-800 text-teal-400 px-1 rounded">MyMCLib</code> class with the provided API token.</p>
<h4 class="text-xl mb-3 text-teal-400">Methods</h4>
<ul class="text-sm opacity-90 leading-relaxed mb-4 list-disc list-inside">
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getTime(): Promise<any></code> - Retrieves the current server time.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getStats(): Promise<any></code> - Retrieves server statistics.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getLog(): Promise<any></code> - Retrieves server logs.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">startServer(): Promise<any></code> - Starts the Minecraft server.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">stopServer(): Promise<any></code> - Stops the Minecraft server.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">restartServer(): Promise<any></code> - Restarts the Minecraft server.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">createMyLink(): Promise<any></code> - Creates a custom link.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">deleteMyLink(): Promise<any></code> - Deletes a custom link.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">createLinkSFTP(): Promise<any></code> - Creates an SFTP link.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">deleteLinkSFTP(): Promise<any></code> - Deletes an SFTP link.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getConnectionHash(): Promise<any></code> - Retrieves a connection hash.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getConnectionHashSFTP(): Promise<any></code> - Retrieves an SFTP connection hash.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getOnlinePlayers(): Promise<any></code> - Retrieves a list of online players.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getWebsiteURL(): Promise<any></code> - Retrieves the server's website URL.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getMapURL(): Promise<any></code> - Retrieves the server's map URL.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">postBan(username: string): Promise<any></code> - Bans a player by username.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">postUnban(username: string): Promise<any></code> - Unbans a player by username.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">postSay(message: string): Promise<any></code> - Sends a message to all players.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">postTell(username: string, message: string): Promise<any></code> - Sends a private message to a player.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">postConsole(command: string): Promise<any></code> - Executes a command in the server console.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">postGive(username: string, item: string, amount: number): Promise<any></code> - Gives an item to a player.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">installMod(modID: string): Promise<any></code> - Installs a mod by ID.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">uninstallMod(modID: string): Promise<any></code> - Uninstalls a mod by ID.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getInstalledMods(): Promise<any></code> - Retrieves a list of installed mods.</li>
</ul>
<h3 class="text-2xl minecraft-font mb-4 text-teal-400">ApiUtils Class</h3>
<h4 class="text-xl mb-3 text-teal-400">Methods</h4>
<ul class="text-sm opacity-90 leading-relaxed mb-4 list-disc list-inside">
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">getRequest(endpoint: ApiEndpoint, token: string): Promise<any></code> - Makes a GET request to the specified API endpoint.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">deleteRequest(endpoint: ApiEndpoint, token: string): Promise<any></code> - Makes a DELETE request to the specified API endpoint.</li>
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">postRequest(endpoint: ApiEndpoint, token: string, data: {}): Promise<any></code> - Makes a POST request to the specified API endpoint with the provided data.</li>
</ul>
</section>
<section id="java-client" class="section-bg p-8 sm:p-10 mb-12">
<h2 class="text-3xl minecraft-font mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500">
Java Client</h2>
<p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed">
We also have a Java client that provides the same functionality. View the documentation at:
</p>
<p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed">
<a href="https://info.my-mc.link/mymc-java/" class="underline text-teal-400 hover:text-blue-400" target="_blank">Java Client Documentation</a>
</p>
</section>
<section id="explore-more" class="section-bg p-8 sm:p-10 text-center mb-12">
<h2 class="text-3xl minecraft-font mb-6 bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500">
Explore More</h2>
<p class="text-lg mb-8 max-w-2xl mx-auto opacity-90 leading-relaxed">
Ready to automate your server with <code class="bg-gray-800 text-teal-400 px-1 rounded">MyMCLib</code><BR>Join our community, dive into our resources, and start building with the My-MC.Link API.
</p>
<div class="flex justify-center gap-4 flex-wrap">
<a href="https://join.my-mc.link" class="btn-minecraft text-base" target="_blank">Join Our Discord</a>
<a href="https://info.my-mc.link" class="btn-minecraft text-base" target="_blank">Explore the Wiki</a>
</div>
</section>
</main>
<footer class="bg-gray-900/20 backdrop-filter backdrop-blur-xl py-8 text-center relative z-10">
<p class="text-sm opacity-90">© 2025 My-MC.Link. All rights reserved.</p>
<p class="text-sm opacity-90 mt-3">
Powered by <a href="https://holesail.io" class="underline" target="_blank">Holesail</a> with services
donated by <a href="https://raven-scott.fyi" class="underline">SNXRaven</a>
</p>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-javascript.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-typescript.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-json.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-bash.min.js"></script>
<script>
function copyCode(button) {
const codeBlock = button.previousElementSibling.querySelector('code');
const text = codeBlock.textContent;
navigator.clipboard.writeText(text).then(() => {
button.textContent = 'Copied!';
button.classList.add('copied');
setTimeout(() => {
button.textContent = 'Copy';
button.classList.remove('copied');
}, 2000);
}).catch(err => {
console.error('Failed to copy: ', err);
});
}
</script>
<script src="../../mc/js/main.js"></script>
</body>
</html>