Skip to content

Commit

Permalink
Merge pull request #14 from nicecraftz/master
Browse files Browse the repository at this point in the history
Add functionality for custom NBT tags in ItemBuilder
  • Loading branch information
AlbeMiglio authored Dec 5, 2023
2 parents bb4b80e + 3fd9a5e commit a53622b
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 a53622b

Please sign in to comment.