CrucialLib 3.0.1 is a patch release with important bug fixes for Bukkit 1.21+ compatibility. No API changes are required for most plugins.
-
Custom item identification migrated from AttributeModifier to PersistentDataContainer
CrucialLib 3.0.0 identified custom items by attaching an
AttributeModifieronAttribute.MAX_HEALTHwith the item's UUID encoded in the modifier name. This broke on Bukkit 1.21.4+ because theAttributeModifier(UUID, String, double, Operation)constructor andAttribute.MAX_HEALTHwere deprecated and the modifier name/UUID were no longer reliably preserved.CrucialLib 3.0.1 stores the item UUID in the
PersistentDataContainerinstead, which is stable across all Bukkit versions since 1.14.Impact: Items created with 3.0.0 that are already in player inventories will not be recognized by 3.0.1's
CrucialItem.getByStack()andCrucialItem.getId()methods, since they still carry the old AttributeModifier-based ID. Newly created items will use the PDC format and work correctly. -
InventoryItem also migrated from AttributeModifier to PersistentDataContainer
InventoryItemused the same AttributeModifier hack to mark items as GUI elements. This has been replaced with a PDC byte marker. -
Stack.addAttributeModifier()deprecatedThe method still exists for backwards compatibility but is marked
@Deprecated(since = "3.0.0"). UseCrucialItemfor custom item identification orInventoryItemfor GUI items instead. -
NamespacedKey lowercase enforcement
Item.createItem()now lowercases the recipe key and name to comply with Bukkit 1.21+'sNamespacedKeyvalidation rules ([a-z0-9/._-]only). Previously, uppercase characters in item names or types could causeIllegalArgumentException.
- Replace
CrucialLib-v3.0.0.jarwithCrucialLib-v3.0.1.jarinplugins/ - Restart the server
- Existing custom items in player inventories (created with 3.0.0) will need to be re-created
-
Update your dependency version to
v3.0.1:Maven:
<dependency> <groupId>com.github.ChafficPlugins</groupId> <artifactId>CrucialLib</artifactId> <version>v3.0.1</version> <scope>provided</scope> </dependency>
Gradle:
compileOnly 'com.github.ChafficPlugins:CrucialLib:v3.0.1' -
If you were calling
Stack.addAttributeModifier()directly, migrate toCrucialItemorInventoryItem(which handle identification automatically). -
No other code changes required -- the
CrucialItemandInventoryItemAPIs are unchanged.
CrucialLib 3.0.0 is a major version with breaking changes. It requires Java 21 and Spigot 1.21+.
- Ensure your server is running Spigot/Paper 1.21 or higher on Java 21
- Remove the old CrucialLib (or CrucialAPI) jar from
plugins/ - Download the latest CrucialLib release
- Place the new jar in
plugins/ - Restart the server
-
Update your dependency version to
v3.0.1:Maven:
<dependency> <groupId>com.github.ChafficPlugins</groupId> <artifactId>CrucialLib</artifactId> <version>v3.0.1</version> <scope>provided</scope> </dependency>
Gradle:
compileOnly 'com.github.ChafficPlugins:CrucialLib:v3.0.1' -
Update your Java source/target to 21 in your build configuration.
-
API renames -- the following Spigot API constants changed in 1.21 and CrucialLib follows suit:
Old (2.x) New (3.0.x) Attribute.GENERIC_MAX_HEALTHAttribute.MAX_HEALTHEnchantment.DURABILITYEnchantment.UNBREAKINGItemFlag.HIDE_POTION_EFFECTSItemFlag.HIDE_ADDITIONAL_TOOLTIP -
Method rename --
Server.checkVersion()is nowServer.checkCompatibility()and accepts varargs instead of aString[]:// Old (2.x) Server.checkVersion(new String[]{"1.16", "1.15"}) // New (3.0.x) Server.checkCompatibility("1.21")
-
Minimum server version -- CrucialLib 3.0.x targets
api-version: 1.21. Servers running older versions are not supported. -
Item identification -- If you were reading AttributeModifiers to identify CrucialItems, use the official API instead:
// Use the official lookup methods CrucialItem item = CrucialItem.getByStack(itemStack); UUID itemId = CrucialItem.getId(itemStack);
CrucialLib is a direct fork of CrucialAPI. If you're migrating from the original CrucialAPI:
- Remove the old
CrucialAPIjar fromplugins/ - Download the latest CrucialLib release
- Place the new jar in
plugins/ - Restart the server
No configuration changes are needed -- existing configs will continue to work.
-
Update your Maven or Gradle coordinates to use JitPack with the new repository:
Maven:
<dependency> <groupId>com.github.ChafficPlugins</groupId> <artifactId>CrucialLib</artifactId> <version>v3.0.1</version> <scope>provided</scope> </dependency>
Gradle:
compileOnly 'com.github.ChafficPlugins:CrucialLib:v3.0.1' -
Update
plugin.yml-- change the dependency name toCrucialLib:depend: [CrucialLib]
-
Update package imports -- replace
io.github.chafficui.CrucialAPIwithio.github.chafficui.CrucialLibin your code.
| Version | Changes |
|---|---|
| 3.0.1 | Bug fix: migrated item identification from AttributeModifier to PersistentDataContainer for Bukkit 1.21+ compatibility; fixed NamespacedKey lowercase enforcement; deprecated Stack.addAttributeModifier(); comprehensive Javadoc added to all public classes |
| 3.0.0 | Java 21, Spigot 1.21+, API modernization (see breaking changes above) |
| 2.2.0 | Last CrucialAPI version, forked as CrucialLib |