Tags
Creators
Details
0.1.0
Compatibility
Changes
skLib 0.1.0
Features
-
Custom Inventories: Create inventories with custom titles and types (e.g., Hopper, Dropper) or custom row-based sizes (up to 6 rows). Titles only support MiniMessage formatting.
-
Item & Click Handlers: Set items in inventory slots and attach custom click handlers to specific slots.
-
Inventory Management: Open inventories for players, track them by UUID, and prevent stealing if marked as unstealable.
-
Event Handling: Handles click, inventory close, and player quit events.
-
Utility Methods: Fill the inventory with one item and close inventories when needed.
How to Use
1. Create a Custom Inventory
GuiInventory gui = new GuiInventory("Title", InventoryTypes.HOPPER, true);
Or with rows: (uses chest)
GuiInventory gui = new GuiInventory("Title", 3, true);
2. Add Items & Click Handlers
gui.setItem(0, new ItemStack(Material.DIAMOND), clickEvent -> {
clickEvent.getPlayer().sendMessage("You clicked the diamond!");
});
3. Open Inventory
gui.open(player);
4. Close Inventory
clickEvent.close();
5. Fill Inventory (sets all of the slots in the inventory to the specified item)
gui.fillInventory(new ItemStack(Material.STONE));
This is a beta release, any suggestions will be appreciated! If you encounter an issue, do report it!
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:N0ZOLHpv:tGW9cutR"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:N0ZOLHpv:tGW9cutR"
}

