-
-
Notifications
You must be signed in to change notification settings - Fork 136
API Events
William edited this page Nov 22, 2022
·
8 revisions
HuskSync provides three API events your plugin can listen to when certain parts of the data synchronisation process are performed. These events deal in HuskSync class types, so you may want to familiarize yourself with the API basics first. Two of the events can be cancelled (thus aborting the synchronisation process at certain stages) and some of the events expose methods letting you affect their outcome (such as modifying the data that is saved during the process).
Consult the Javadocs for more information -- and don't forget to register your listener when listening for these event calls. Please note that carrying out expensive blocking operations during these events is strongly discouraged as this may affect plugin performance.
Bukkit Event class | Cancellable | Description |
---|---|---|
BukkitDataSaveEvent |
✅ | Called when player data snapshot is created, saved and cached due to a DataSaveCause |
BukkitPreSync |
✅ | Called before a player has their data updated from the cache or database, just after login |
BukkitSyncCompleteEvent |
❌ | Called once a player has completed their data synchronisation on login successfully |
This documentation is available via william278.net |
---|
- 📚 Setup
- 💾 Database
- ✨ Redis
⚠️ Compatibility- 📄 Config File
- 🔗 Troubleshooting
- 🖥️ Commands
- ✅ Sync Features
- ⚙️ Sync Modes
- ↪️ Data Rotation
- ❓ FAQs
↗️ Legacy Migration- ✨ MPDB Migration
- ☂️ Dumping UserData
- 🟩 Plan Hook
- 📋 Event Priorities
- ⚔️ Keep Inventory
- 🎏 Translations
- 💻 GitHub
- 📂 Buy HuskSync
- 🚰 Spigot
- 🛒 Polymart
- ⚒️ BuiltByBit
- 💬 Discord Support