Releases: BTW-Community/BTW-CustomPlayerDataExampleAddon
Release list
Custom Player Data Example Addon v1.1.1
What’s new in this release
- Fixed localization file detection — Language files now use the correct case-sensitive names (e.g.,
en_US.lang), ensuring they load outside the dev environment. - Minimal use of mixins — Only a simple accessor mixin to read the player’s language from EntityPlayerMP, avoiding reflection.
- Improved message handling — Welcome messages now use BTW/vanilla APIs for safer string substitution.
- Modified pluralization support —
.langfiles include multiple forms of the welcome phrase for flexible, language-specific pluralization.
Summary
| Feature | v1.0.0 | v1.1.0 | v1.1.1 |
|---|---|---|---|
| Raw NBT storage | ✅ | ❌ | ❌ |
| PlayerDataEntry API | ❌ | ✅ | ✅ |
| Client sync | ❌ | ✅ | ✅ |
| Minecraft's Translation API | ❌ | ❌ | ✅ |
| Localization | ❌ | ✱ | ✅ |
| Mixins | ✅ | ❌ | 🤏🏻 |
✱ In v1.1.0, localization was implemented, but the language files used lowercase filenames, preventing them from loading when building from source.
🤏🏻 Only employs an accessor mixin to get "private String translator" from EntityPlayerMP. This is how it reads the player's language from client-side to server-side.
Custom Player Data Example Addon v1.1.0
An updated Better Than Wolves CE addon demonstrating per-player persistent data using the official PlayerDataEntry API, with improved client-server syncing and localized join-count messages.
What’s new in this release
- Uses BTW’s
PlayerDataEntrysystem now instead of raw NBT for safer, automatic storage. - Player join counts are now synchronized to the client immediately.
- Welcome messages are localized and properly pluralized for multiple languages.
- The addon no longer requires mixins for simple per-player data.
Demo
When joining a world, you will see a message like:
Welcome back! You have joined 3 times.
This confirms:
- The join count is persisted across deaths, respawns, and world reloads.
- Data is saved in the player’s
.datfile automatically. - Values are synchronized between server and client immediately.
Custom Player Data Example Addon v1.0.0
An example Better Than Wolves CE addon demonstrating how to attach and persist custom per-player data (stored in NBT), using a simple in-game counter that increases each time the player loads into a world.
What this example shows
This addon demonstrates how to:
- Add a new integer field (
customValue) to every player. - Save and load that data automatically using NBT.
- Preserve it across deaths, respawns, and world reloads.
- Display the value in chat to confirm it’s working.
When you join a world, you’ll see a message like:
[CustomPlayerData] You have joined this world 3 times.
This confirms that:
- The data is saved to the player’s NBT.
- It persists across sessions.
- It’s properly transferred when the player respawns.
You can use this same pattern to store any type of per-player data — integers, booleans, or strings — that you want to survive between play sessions.