Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/toxicity188/datacomponentapi

This is a simple API for data component!
https://github.com/toxicity188/datacomponentapi

1-20-6 api bukkit data-components library minecraft plugin

Last synced: 2 months ago
JSON representation

This is a simple API for data component!

Awesome Lists containing this project

README

        

# DataComponentAPI

This is a simple API for data component!

### Usage in library plugin
``` java
public class TestPlugin extends JavaPlugin {
@Override
public void onEnable() {
var apply = DataComponentAPI.api().adapter(new ItemStack(Material.DIAMOND_SWORD));
apply.set(NMS.nms().damage(), 3);
apply.set(NMS.nms().repairCost(), 20);
apply.set(NMS.nms().rarity(), Rarity.EPIC);
getLogger().info(apply.serialize().toString());
}
}
```

### Usage in shade
``` java
public class TestPlugin extends JavaPlugin {
@Override
public void onEnable() {
DataComponentAPIBukkit.load();

var apply = DataComponentAPI.api().adapter(new ItemStack(Material.DIAMOND_SWORD));
apply.set(NMS.nms().damage(), 3);
apply.set(NMS.nms().repairCost(), 20);
apply.set(NMS.nms().rarity(), Rarity.EPIC);
getLogger().info(apply.serialize().toString());
}
}
```

### How to use
``` kotlin
repositories {
mavenCentral()
maven("https://jitpack.io")
}

dependencies {
implementation("com.github.toxicity188:DataComponentAPI:master-SNAPSHOT")
}
```