The CoreAPI provides essential features and access to the internal server core of MineValleyEU, used in all modules.
Note
To move more logic and data management to the proxy, many API features have been moved to the ProximaAPI. Because the CoreAPI depends on the ProximaAPI, you can still access those features through the CoreAPI.
To use the CoreAPI in your module, we provide a Maven repository hosted on GitHub.
Before proceeding, ensure you’ve added a token to your settings.xml file (details below).
<repository>
<id>core-api</id>
<url>https://maven.pkg.github.com/MineValley/CoreAPI</url>
</repository><dependency>
<groupId>eu.minevalley</groupId>
<artifactId>core-api</artifactId>
<version>1.306.0</version>
<scope>provided</scope>
</dependency>While the API is publicly accessible, a GitHub account is required to access the repository. If you already have an account, follow these steps to create a token:
Important
Opting for a token with no expiration increases the likelihood of unauthorized access and should be carefully
considered.
Reusing the same token across multiple purposes or devices significantly increases the potential damage in the event
of a leak.
- Go to Settings on GitHub (top-right corner, click your profile picture → Settings).
- Scroll down and select Developer settings → Personal access tokens → Tokens (classic).
- Click Generate new token and choose Generate new token (classic) from the dropdown.
- Add a meaningful name in the Note field (e.g., "MineValley" or "CoreAPI").
- Under Expiration, select a valid duration for the token. Once expired, you'll need to create a new token.
Alternatively, you can select No expiration for permanent use. - Check the box for read:packages.
- Click Generate token and copy the token.
Once you have your token, add it to the settings.xml file of your Maven installation. Replace USERNAME with your
GitHub username and TOKEN with the generated token.
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>core-api</id>
<username>USERNAME</username>
<password>TOKEN</password>
</server>
</servers>
</settings>Tip: In IntelliJ, you can create a
settings.xmlfile by right-clicking on thepom.xmlof any project and selecting Create settings.xml.
I'm having issues with Eclipse.
- Use IntelliJ.
I’m unsure if I used the correct GitHub username.
- You can find your GitHub username on your profile page. If in doubt, try logging in with your username. If it works, it’s correct.
Can I choose the content of <id> freely?
- Yes, the content of
<id>in both thesettings.xmlandpom.xmlcan be freely chosen, but it must be the same in both files.
I followed all steps, but the api (or a specific version of it) could not be found.
- Click Maven in the right-hand sidebar.
- Press the Reload All Maven Projects button (top-left).
- If the problem persists, go to File → Invalidate Caches... → Invalidate and Restart.
- If the problem persists, check whether the repository id and the id in your
settings.xmlis the same - If the problem persists, delete the repository in your .m2 folder and run
mvn package -Uin your project - If steps 1-5 didn't work or the problems appears regulary (e.g. when updating the core-api version), try to (re-)install the newest intelliJ version and uninstall old ones
