About CustomDataLib
From Steam WorkshopTHIS LIBRARY MOD HAS REPLACED [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2902029535]CustomPlayerLib AND YOU SHOULD NOT USE THAT LIBRARY AS IT IS OUTDATED AND BROKEN. Base…
THIS LIBRARY MOD HAS REPLACED CustomPlayerLib AND YOU SHOULD NOT USE THAT LIBRARY AS IT IS OUTDATED AND BROKEN.
Base implementation for custom player data. This is a library and doesn't add any functionality itself.
Docs available here.
Credits
Huge credit to darkluke1111 on discord for pointing out previous issues with the library and helping me fix them. As well as brainstorming with me on how to make the library better. And generally reviewing my code and suggesting some improvements. Credit for the CustomMob idea goes to real_thunderbear on discord as they needed it. I just added it to the library for ease of use for anyone in the future.
For Developers
Example mod using this library: To be added
Make sure to modify your build.gradle file:
- Add to dependencies: [code]compileOnly "com.jubiman:customdatalib:1.+"[/code]
- Add top level: [code]project.ext.modDependencies = ["com.jubiman.customdatalib"][/code]
- If gradle can't resolve the package, add to the repositories (it should find it as it is in the Maven Central repository):
- [code]
- maven {
- url "https://s01.oss.sonatype.org/content/repositories/releases/"
- }
- [/code]
Using the library
First off I recommend reading the documentation here
Custom Player Data
This is mostly the same as the original CustomPlayerLib. First you want to create a CustomPlayer class, which has a constructor with a long as argument. All code fragments can be found in the example
public class MyPlayer extends CustomPlayer {
public MyPlayer(long auth) {
super(auth);
}
}
Then create a CustomPlayersHandler class, which does the logic for all players in the game.
public class MyPlayersHandler extends CustomPlayersHandler<MyPlayer> {
// It's recommended to store the name in a static constant, so you can easily access it
public static final String name = "myplayers";
public MyPlayersHandler() {
super(MyPlayer.class, name);
}
// These methods are not necessary, but they are recommended.
/**
* This replaces CustomPlayerRegistry.get(MyPlayers.name).get(auth)
* with MyPlayers.getPlayer(auth).
* It's just less code to write :)
*/
public static MyPlayersHandler getInstance() {
return (MyPlayersHandler) CustomPlayerRegistry.INSTANCE.get(name);
}
/**
* A null safe way to get a player from the map, adds player if they don't exist yet
* @param auth the authentication of the player's ServerClient
* @return the MyPlayer object belonging to the player
*/
public static MyPlayer getPlayer(long auth) {
return getInstance().get(auth);
}
}
Then at last we need to register the classes by adding the following line to your mod's (annotated with @ModEntry) init() function:
CustomPlayerRegistry.register(MyPlayersHandler.name, MyPlayersHandler.class);
New modular system
Instead of extending a different base class like CustomPlayerTickable, you can implement one or many of the different interfaces. Currently supported are: ClientTickable, Syncable, Savable and HUDDrawable. All CustomData classes are tickable from the server-side, but by defining it as ClientTickable it will also be ticked on the client-side. Please note that ClientTickable and Syncable require extra steps in order to properly function
ClientTickable
Currently only CustomPlayers are supported, as I do not see the need for client-side mob ticking. This interface should mainly be used to cache values on the client-side which could be used by the HUDDrawable interface. Most of the times you can ignore this interface. Please keep in mind that currently, only CustomPlayers are supported.
Syncable
The Syncable interface requires you to create a new packet: PacketMyPlayerSync (or whaterver your custom player naming is). A new instance of this packet will be created in the getSyncPacket() class you implement from the Syncable interface. The isContinuousSync() function should usually return false, as this will only sync once when the player connects. If this is set to true, the sync packet will be sent every second. An example of the custom packet:
public class PacketSyncPlayer extends Packet {Highlights
From source dataFootprint
A 41 KB download, rated a light load on a server.
Last update
Its author last shipped an update 19 mo ago.
CustomDataLib on Nxeon
From our catalogue- One-click install
- Supported on Nxeon Necesse servers. We download it from Steam Workshop, place it, and restart the server.
- Server load
- light
- Smallest plan we suggest
- Necesse — 1 GB (1 GB RAM). This follows our own load rating above, not a benchmark.
- Latest build
- 2025-03-24, released 2025-03-24, 41 KB
Game versions by loader
| Loader | Game versions | Newest |
|---|---|---|
| Workshop |
From 1 recorded build of CustomDataLib.
Run CustomDataLib on a Necesse server
Pick a server or deploy a new one above; it is installed in one click.
What kind of mod it is
From the catalogLibraries & compatibility
Foundations and fixes other mods build on. Usually installed because something else needs it.
Compatibility
- Game
- Necesse
- File size
- 41 KB
Verified at the source
- ✓Steam WorkshopOfficial listing, checked 2026-10-10Open ↗
- ✓AuthorJubiman, as published on Steam Workshop
- ✓LicenseNot published by the sourceFree
