Speedgot
DataComponentAPI
-----
This is a simple API for data component!
Download Now
66.6 KB .jar
Overview
Updates (
--
)
Reviews (
---
)
Version History
Discussion
This is a simple API for data component!
It supports data component edit, json serialize/deserialize.
Usage in library plugin
Code (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
Code (Text):
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
Code (Kotlin):
repositories
{
mavenCentral
(
)
maven
(
"https://jitpack.io"
)
}
dependencies
{
implementation
(
"com.github.toxicity188:DataComponentAPI:master-SNAPSHOT"
)
}
View on SpigotMC
Resource Information
Author:
----------
Total Downloads:
42
First Release:
May 15, 2024
Last Update:
May 15, 2024
Category:
---------------
All-Time Rating:
0 ratings
Version
-----
Released:
--------------------
Downloads:
------
Version Rating:
----------------------
--
ratings