PersistentDataAPI is a more accessible way to approach the quite new, and powerfull storage that mojang provided to minecraft servers since 1.14. This API will perform faster, and better when storing information on players, items, and even blocks.
Persistent data is a new way to store data inside a player/item/block. The data is persistent, which means it's permenant. The data will change only when it's asked to perform a change. The data will be stored even after the plugin (that wrote the data) is removed from the server.
To use it you'll have to add the repository and dependency to your pom.xml
Currently, the api will use Jitpack, as the host of the repo, so:
Repository:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
Dependency:
<dependency>
<groupId>com.github.Evyaaa</groupId>
<artifactId>PersistentDataAPI</artifactId>
<version>2.0.2</version>
</dependency>
Write this method in the onEnable() method, in main class
PersistentDataAPI api = new PersistentDataAPI(this);
You have to register this method in the main class, as it requires a JavaPlugin instance;
Once you've initalized the api, you can freely work with it, to match your needs.
The documentation can be found here:
https://evyaaa.github.io/PersistentDataAPI/
- Publish a first edition of the api.
- Support persistent data containers in items.
- Support persistent data containers in blocks.
- Create and support custom data types.
- Create custom events that support persistent data.
- Support persistent data in chunks.
This api was created fully by TheHandsomeYoni. For any questions/support you can contact my email:
Or my Discord:
Evyaaa#0523