Rarity Lib Library
About Compatibility
This library is specifically designed for the Better than Adventure modification, which represents a deeply reworked version of Minecraft b1.7.3. It requires a modified version of Fabric called Babric for operation.
Main Features
This library provides developers with a convenient tool for adding a rarity system to items in their mods. You can assign items one of six rarity levels:
- COMMON
- UNCOMMON
- RARE
- ULTRA RARE
- EPIC
- MYTHIC
The library also includes a special item - Magnifying Glass, which allows players to check the rarity of any item in the game.
Usage Instructions
Installation
Add to the build.gradle file:
repositories {
maven { url = "https://jitpack.io" }
}
dependencies {
modImplementation "com.github.Garkatron:RarityLib:${project.rarity_lib_version}"
}
Code Example for BTA 7.2pre1
// Your item
public static Item your_item;
// Item creator
public static final ItemBuilder GenericItemBuilder = new ItemBuilder(MOD_ID);
// Creating the item
Item _item = GenericItemBuilder.build(item);
// Assigning the rarity level
((IItemRarityMixin) _item).rarityLib$setRarityLevel(RarityLevel.COMMON);
your_item = _item;
Code Example for BTA 7.1
// Your item
public static Item your_item;
// Creating the item
Item _item = ItemHelper.createItem(arguments);
// Assigning the rarity level
((IItemRarityMixin) _item).rarityLib$setRarityLevel(RarityLevel.COMMON);
your_item = _item;