HomeJavaModsThe New Item Library
About
The New Item Library is an item library that allows for easy serialization, and deserialization of items(enchanted, potions, books, shulker boxes of potions, etc). It also provides a calculations class that may be used to count, add, and remove items from a library, with plans for expanding the utility classes with future releases.


How To Use
In order to use this library, you must first download the library and add it as a dependency to your project. After that please use the example code below on how to use it, or if you'd like to visually learn, check out the source code to the project
here .

Spoiler: Sample Code
Code (Java):

    //First we setup our itemstack.
    ItemStack stack = new ItemStack ( Material. DIAMOND_SWORD ) ;
    ItemMeta meta = stack. getItemMeta ( ) ;
    meta. setDisplayName ( ChatColor. GOLD + "Non-Epic Sword" ) ;
    stack. addEnchantment ( Enchantment. FIRE_ASPECT , 2 ) ;
    stack. addEnchantment ( Enchantment. KNOCKBACK , 2 ) ;
    stack. addEnchantment ( Enchantment. DAMAGE_ALL , 5 ) ;

    //Now we Serialize our ItemStack.
    final String serialized = SerialItem ( ) . serialize ( stack ) ;
    System . out . println ( serialized ) ;

    //Now we unserialize it.
    try {
      stack = SerialItem. unserialize ( serialized ) . getStack ( ) ;
    } catch ( ParseException ignore ) {
      //Invalid JSON String
    }

    //Now we re-serialize for our sanity check.
    final String reserialized = SerialItem ( ) . serialize ( stack ) ;
    System . out . println ( reserialized ) ;


MAVEN
The New Item Library also supports maven. In order to use it with your maven project use the following information:


Code (YAML):
<repositories >
      <repository >
          <id>tne-repo</id >
          <url>https://maven.pkg.github.com/TheNewEconomy/packages/</url >
      </repository >
  </repositories >

    <dependencies >
     <dependency >
        <groupId>net.tnemc</groupId >
        <artifactId>TheNewItemLibrary</artifactId >
        <version>0.1.3.0</version >
     </dependency >
  </dependencies>

Known Caveats
This is a list of known caveats:


Support
For support choose one of the following.


Team

Contribute
To contribute to The New Economy you may fork our Github Repository, and make a Pull Request. The repository is located at: https://github.com/TheNewEconomy/TheNewItemLibrary .
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

The New Item Library is a free Minecraft Java mod. Compatible with Minecraft 1.13. Downloaded 298 times (via Spigot). Download it and open it directly in the game.

Explore more