Skip to content

Commit

Permalink
Add functionality for custom NBT tags in ItemBuilder
Browse files Browse the repository at this point in the history
A new method `addPersistentValue` has been added to the ItemBuilder class, allowing for the addition of custom NBT tags to items. This provides more flexibility in item customization.
  • Loading branch information
nicecraftz committed Dec 4, 2023
1 parent bb4b80e commit 3fd9a5e
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ public ItemBuilder setMaterial(Material material) {
return this;
}

/**
* Adds a custom NBT tag to the item
*
* @param type The PersistentDataType
* @param key The key
* @param value The value
*/
public <V> ItemBuilder addPersistentValue(PersistentDataType<?, V> type, String key, V value) {
NBT.put(key, new Pair<>(type, value));
return this;
}

/**
* Sets the item's material getting it from a String
*
Expand Down

0 comments on commit 3fd9a5e

Please sign in to comment.