Description
Examples
Editing kills/deaths
Information
Plugins that use this API
Donations
Take out all the hassle with creating a database or configuration file for each plugin you make! Let my plugin do the work for you. Carefully crafted, my plugin will enable you to easily implement editing and saving custom variables associated with a player.
Examples
Editing kills/deaths
Spoiler: PlayerDeathEvent
In the above example you can see we're adding kills and deaths to the players. It's this simple to use, and don't worry, it can even handle some of the more complex things you may need.
Code (Text):
@EventHandler
public void event(PlayerDeathEvent event) {
Player player = event.getEntity();
Player killer = player.getKiller();
PlayerSave playerSave = JavaPlugin.getPlugin(PlayerSave.class);
playerSave.data(player).getInt("deaths").add(1);
if (killer != null) {
playerSave.data(killer).getInt("kills").add(1);
}
}
public void event(PlayerDeathEvent event) {
Player player = event.getEntity();
Player killer = player.getKiller();
PlayerSave playerSave = JavaPlugin.getPlugin(PlayerSave.class);
playerSave.data(player).getInt("deaths").add(1);
if (killer != null) {
playerSave.data(killer).getInt("kills").add(1);
}
}
Information
The plugin loads data before the player is able to log in, but it should never cause a player to timeout. Once a player logs out the plugin will keep the information in memory for a minute before it saves it to disk. It will not save it to disk unless the player logs out, so if the server crashes any information from login will be lost. Although dependant plugins have an option to manually save if they so wish.
All data is stored inside the plugin folder and is compressed using Gzip to conserve space. The files names are based on a players UUID, exactly how Minecraft handles their saves.
The download comes bundled with the Javadoc.
All data is stored inside the plugin folder and is compressed using Gzip to conserve space. The files names are based on a players UUID, exactly how Minecraft handles their saves.
The download comes bundled with the Javadoc.
Plugins that use this API
(Message me to be added to this list)
Donations
Quick facts
- Edition: Minecraft Java
- File type: .jar
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
[API] PlayerSave is a free Minecraft Java mod. Downloaded 362 times (via Spigot). Download it and open it directly in the game.
![[IMG]](http://proxy.spigotmc.org/74e8fb3df5cef53a89ee96059403abd591c51ee4?url=http%3A%2F%2Fi.imgur.com%2FCl4zOJH.png)
![[IMG]](http://proxy.spigotmc.org/c424e562082644f7cc3bd6cf0abfb5796858916b?url=http%3A%2F%2Fi.imgur.com%2FXvRlNtw.png)