Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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!
- Host: GitHub
- URL: https://github.com/toxicity188/datacomponentapi
- Owner: toxicity188
- License: mit
- Created: 2024-05-15T00:40:32.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-08-28T14:08:35.000Z (4 months ago)
- Last Synced: 2024-10-11T03:03:06.820Z (2 months ago)
- Topics: 1-20-6, api, bukkit, data-components, library, minecraft, plugin
- Language: Java
- Homepage:
- Size: 134 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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")
}
```