Compatibility
Minecraft: Java Edition
1.21.1
Platforms
Links
Tags
Creators
Details
Licensed LGPL-3.0-only
Published 2 days ago
TailsLib
This project still under heavy development!
TailsLib is a library that allows developers to create custom items and blocks through code with almost no effort.
How to use it?
Java
Create new java file and implement CustomItem.
MyItem.java
public class TestItem implements CustomItem {
// ID of this item.
@Override
public String id() {
return "myitem";
}
// Basic builder for this item.
@Override
public CustomItemBuilder createBuilder() {
return new CustomItemBuilder(Material.DIAMOND) // Material of this item in-game
.name("My own item.") // Display name
.loreString(List.of("Hello!")); // Adding lore strings. (.lore for Component#text)
}
// Handling left click.
@Override
public void leftClick(CustomItemRuntime item, PlayerInteractEvent event) {
event.getPlayer().sendMessage("Heya, you left clicked me!"); // Sending message
}
}
Register your item in your main class.
public class Main extends JavaPlugin {
@Override
public void onEnable() {
...
CustomItemManager.getManager().register(new MyItem());
...
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
Enjoy!
Installation
Check docs for more info and versions.
Gradle
repositories {
...
maven("https://repo.papermc.io/repository/maven-public/")
...
}
dependencies {
...
compileOnly("ru.thisistails:TailsLib:VERSION")
...
}


