576 lines
34 KiB
HTML
576 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">Java Library for 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-minecraft-server">Starting the Minecraft Server</a></li>
|
|
<li><a href="#stopping-minecraft-server">Stopping the Minecraft Server</a></li>
|
|
<li><a href="#restarting-minecraft-server">Restarting the Minecraft Server</a></li>
|
|
<li><a href="#creating-custom-link">Creating a Custom Link</a></li>
|
|
<li><a href="#deleting-custom-link">Deleting a Custom Link</a></li>
|
|
<li><a href="#creating-sftp-link">Creating an SFTP Link</a></li>
|
|
<li><a href="#deleting-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-website-url">Getting Server's Website URL</a></li>
|
|
<li><a href="#getting-map-url">Getting Server's Map URL</a></li>
|
|
<li><a href="#banning-player">Banning a Player</a></li>
|
|
<li><a href="#unbanning-player">Unbanning a Player</a></li>
|
|
<li><a href="#sending-message-all">Sending a Message to All Players</a></li>
|
|
<li><a href="#sending-private-message">Sending a Private Message to a Player</a></li>
|
|
<li><a href="#executing-console-command">Executing a Command in Server Console</a></li>
|
|
<li><a href="#giving-item">Giving an Item to a Player</a></li>
|
|
<li><a href="#installing-mod">Installing a Mod by ID</a></li>
|
|
<li><a href="#uninstalling-mod">Uninstalling a Mod by ID</a></li>
|
|
<li><a href="#retrieving-installed-mods">Retrieving a List of Installed Mods</a></li>
|
|
<li><a href="#api-reference">API Reference</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 Maven:
|
|
</p>
|
|
<div class="code-block-wrapper">
|
|
<pre class="language-xml"><code><dependency>
|
|
<groupId>io.github.mrmasrozytlive</groupId>
|
|
<artifactId>mymc-java-lib</artifactId>
|
|
<version>1.2.0</version>
|
|
</dependency></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">
|
|
or via Gradle:
|
|
</p>
|
|
<div class="code-block-wrapper">
|
|
<pre class="language-gradle"><code>implementation group: 'io.github.mrmasrozytlive', name: 'mymc-java-lib', version: '1.2.0'</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">
|
|
For other ways, visit:<BR> <a href="https://central.sonatype.com/artifact/io.github.mrmasrozytlive/mymc-java-lib" target="_blank">https://central.sonatype.com/artifact/io.github.mrmasrozytlive/mymc-java-lib</a>.
|
|
</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 into your project:
|
|
</p>
|
|
<div class="code-block-wrapper">
|
|
<pre class="language-java"><code>import net.mitask.MyMCLib;</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">
|
|
Then, create an instance of <code class="bg-gray-800 text-teal-400 px-1 rounded">MyMCLib</code> by providing your API token:
|
|
</p>
|
|
<div class="code-block-wrapper">
|
|
<pre class="language-java"><code>MyMCLib myMcLink = new MyMCLib("API_KEY_HERE");</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
<h3 class="text-xl minecraft-font mb-3 text-teal-400 mt-8">Example Usage</h3>
|
|
<div class="code-block-wrapper">
|
|
<pre class="language-java"><code>import net.mitask.MyMCLib;
|
|
|
|
public class YourClass {
|
|
public void yourMethod() {
|
|
MyMCLib myMcLink = new MyMCLib("API_KEY_HERE");
|
|
|
|
// Will print information about API key expiration date
|
|
System.out.println(myMcLink.getTime().toString());
|
|
}
|
|
}</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
<p class="text-sm opacity-90 leading-relaxed mt-4"><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-java"><code>JSONObject timeData = myMcLink.getTime();
|
|
System.out.println(timeData.toString());</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-java"><code>JSONObject statsData = myMcLink.getStats();
|
|
System.out.println(statsData.toString());</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-java"><code>JSONObject logData = myMcLink.getLog();
|
|
System.out.println(logData.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 4. Starting the Minecraft Server -->
|
|
<div id="starting-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-java"><code>JSONObject startResult = myMcLink.startServer();
|
|
System.out.println(startResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 5. Stopping the Minecraft Server -->
|
|
<div id="stopping-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-java"><code>JSONObject stopResult = myMcLink.stopServer();
|
|
System.out.println(stopResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 6. Restarting the Minecraft Server -->
|
|
<div id="restarting-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-java"><code>JSONObject restartResult = myMcLink.restartServer();
|
|
System.out.println(restartResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 7. Creating a Custom Link -->
|
|
<div id="creating-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-java"><code>JSONObject customLinkResult = myMcLink.createMyLink();
|
|
System.out.println(customLinkResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 8. Deleting a Custom Link -->
|
|
<div id="deleting-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-java"><code>JSONObject deleteLinkResult = myMcLink.deleteMyLink();
|
|
System.out.println(deleteLinkResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 9. Creating an SFTP Link -->
|
|
<div id="creating-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-java"><code>JSONObject sftpLinkResult = myMcLink.createLinkSFTP();
|
|
System.out.println(sftpLinkResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 10. Deleting an SFTP Link -->
|
|
<div id="deleting-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-java"><code>JSONObject deleteSftpLinkResult = myMcLink.deleteLinkSFTP();
|
|
System.out.println(deleteSftpLinkResult.toString());</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-java"><code>JSONObject hashData = myMcLink.getConnectionHash();
|
|
System.out.println(hashData.toString());</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-java"><code>JSONObject sftpHashData = myMcLink.getConnectionHashSFTP();
|
|
System.out.println(sftpHashData.toString());</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-java"><code>JSONObject playersData = myMcLink.getOnlinePlayers();
|
|
System.out.println(playersData.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 14. Getting Server's Website URL -->
|
|
<div id="getting-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-java"><code>JSONObject websiteURL = myMcLink.getWebsiteURL();
|
|
System.out.println(websiteURL.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 15. Getting Server's Map URL -->
|
|
<div id="getting-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-java"><code>JSONObject mapURL = myMcLink.getMapURL();
|
|
System.out.println(mapURL.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 16. Banning a Player -->
|
|
<div id="banning-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-java"><code>JSONObject banResult = myMcLink.postBan("username");
|
|
System.out.println(banResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 17. Unbanning a Player -->
|
|
<div id="unbanning-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-java"><code>JSONObject unbanResult = myMcLink.postUnban("username");
|
|
System.out.println(unbanResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 18. Sending a Message to All Players -->
|
|
<div id="sending-message-all" 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-java"><code>JSONObject sayResult = myMcLink.postSay("Hello, everyone!");
|
|
System.out.println(sayResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 19. Sending a Private Message to a Player -->
|
|
<div id="sending-private-message" 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-java"><code>JSONObject tellResult = myMcLink.postTell("username", "Hey, how are you?");
|
|
System.out.println(tellResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 20. Executing a Command in Server Console -->
|
|
<div id="executing-console-command" 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-java"><code>JSONObject consoleResult = myMcLink.postConsole("say Hello, world!");
|
|
System.out.println(consoleResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 21. Giving an Item to a Player -->
|
|
<div id="giving-item" 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-java"><code>JSONObject giveResult = myMcLink.postGive("username", "item", 1);
|
|
System.out.println(giveResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 22. Installing a Mod by ID -->
|
|
<div id="installing-mod" 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-java"><code>String modID = "exampleMod123";
|
|
JSONObject installResult = myMcLink.installMod(modID);
|
|
System.out.println(installResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 23. Uninstalling a Mod by ID -->
|
|
<div id="uninstalling-mod" 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-java"><code>String modID = "exampleMod123";
|
|
JSONObject uninstallResult = myMcLink.uninstallMod(modID);
|
|
System.out.println(uninstallResult.toString());</code></pre>
|
|
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 24. Retrieving a List of Installed Mods -->
|
|
<div id="retrieving-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-java"><code>JSONObject installedMods = myMcLink.getInstalledMods();
|
|
System.out.println(installedMods.toString());</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-xl minecraft-font mb-3 text-teal-400">MyMCLib Class</h3>
|
|
<h4 class="text-lg font-bold mb-2">Constructor</h4>
|
|
<div class="code-block-wrapper">
|
|
<pre class="language-java"><code>public MyMCLib(String token)</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-lg font-bold mb-2 mt-6">Methods</h4>
|
|
<ul class="text-sm opacity-90 leading-relaxed list-disc pl-6 mb-4">
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getTime()</code> - Retrieves the current server time.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getStats()</code> - Retrieves server statistics.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getLog()</code> - Retrieves server logs.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject startServer()</code> - Starts the Minecraft server.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject stopServer()</code> - Stops the Minecraft server.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject restartServer()</code> - Restarts the Minecraft server.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject createMyLink()</code> - Creates a custom link.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject deleteMyLink()</code> - Deletes a custom link.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject createLinkSFTP()</code> - Creates an SFTP link.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject deleteLinkSFTP()</code> - Deletes an SFTP link.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getConnectionHash()</code> - Retrieves a connection hash.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getConnectionHashSFTP()</code> - Retrieves an SFTP connection hash.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getOnlinePlayers()</code> - Retrieves a list of online players.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getWebsiteURL()</code> - Retrieves the server's website URL.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getMapURL()</code> - Retrieves the server's map URL.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject postBan(String username)</code> - Bans a player by username.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject postUnban(String username)</code> - Unbans a player by username.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject postSay(String message)</code> - Sends a message to all players.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject postTell(String username, String message)</code> - Sends a private message to a player.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject postConsole(String command)</code> - Executes a command in the server console.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject postGive(String username, String item, int amount)</code> - Gives an item to a player.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject installMod(String modID)</code> - Installs a mod by ID.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject uninstallMod(String modID)</code> - Uninstalls a mod by ID.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getInstalledMods()</code> - Retrieves a list of installed mods.</li>
|
|
</ul>
|
|
|
|
<h3 class="text-xl minecraft-font mb-3 text-teal-400 mt-8">ApiUtils Class</h3>
|
|
<h4 class="text-lg font-bold mb-2">Methods</h4>
|
|
<ul class="text-sm opacity-90 leading-relaxed list-disc pl-6 mb-4">
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject getRequest(ApiEndpoint endpoint, String token)</code> - Makes a GET request to the specified API endpoint.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject deleteRequest(ApiEndpoint endpoint, String token)</code> - Makes a DELETE request to the specified API endpoint.</li>
|
|
<li><code class="bg-gray-800 text-teal-400 px-1 rounded">JSONObject postRequest(ApiEndpoint endpoint, String token, JSONObject data)</code> - Makes a POST request to the specified API endpoint with the provided data.</li>
|
|
</ul>
|
|
</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?<BR>Join our community, dive into our resources, and start building with the My-MC.Link API and MyMCLib.
|
|
</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-java.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-xml-doc.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-gradle.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="https://my-mc.link/js/main.js"></script>
|
|
</body>
|
|
|
|
</html> |