HomeJavaModsItemStackLib
Usage
ItemStackLib provides methods to do two things that the Bukkit API still lacks: The possibility to apply attributes like attack damage or armor to ItemStacks and Base64 encoded texture values to player head ItemStacks. Values to use for heads can be found for example here included in commands, like:
/give @p player_head 1 {display:{Name:"Bread"},SkullOwner:{Id:" a75e3f60-2242-4429-8ece-bcde77",Properties:{textures:[{Value:" eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjM0ODdkNDU3ZjkwNjJkNzg3YTNlNmNlMWM0NjY0YmY3NDAyZWM2N2RkMTExMjU2ZjE5YjM4Y2U0ZjY3MCJ9fX0="}]}}}
Click to expand...
UUID
Base64 texture value

JavaDocs

Code example:
Code (Text):
// Item attributes
ItemStack sword = new ItemStack(Material.IRON_SWORD);
sword = AttributeWrapper.builder()
       .attribute(InternalAttribute.GENERIC_ATTACK_DAMAGE)
       .name("myattribute")// Optional
       .operation(InternalOperation.ADD_NUMBER)
       .amount(10.35)
       .slots(InternalSlot.HAND)// Optional
       .build()
       .applyTo(sword);

Collection<AttributeWrapper> modifiers = ItemUtil.getAttributes(sword);

// To remove all modifiers of a specific attribute:
ItemUtil.removeAttributeType(sword, InternalAttribute.GENERIC_ATTACK_DAMAGE);
// To remove all modifiers that have a specific name:
ItemUtil.removeAttribute(sword, "myattribute");

// Skulls with Base64 texture value
String texture = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmM2NDVhNDI1OTg3ZjNiN2MyZmFjMDIwNmNlOThiYTVlMjNiOWM0ODUyZmVhNWIxOTc4Zjc0NjdlOGQzMTMifX19";
ItemStack texturedSkull = ItemUtil.setSkullOwner(head, player.getUniqueId(), textureValue);
String textureFromSkull = ItemUtil.getTextureValue(head);
Maven
Code (Text):
   <dependencies>
       <dependency>
           <groupId>de.erethon</groupId>
           <artifactId>itemstacklib</artifactId>
           <version>2.0.1</version>
       </dependency>
   </dependencies>
   <repositories>
       <repository>
           <id>dre-repo</id>
           <url>https://erethon.de/repo/</url>
       </repository>
   </repositories>
ItemStackLib is a library that developers can shade or copy into their own plugin. This is not a standalone plugin. Shading libraries can be done using Maven and its shade plugin:
Code (Text):
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <artifactSet>
                                <includes>
                                    <include>de.erethon:itemstacklib</include>
                                </includes>
                            </artifactSet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
License
Written in 2018 by Daniel Saukel

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide.

This software is distributed without any warranty.

You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.

(tl;dr; do whatever you want with this without asking)
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.

ItemStackLib is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 1,204 times (via Spigot). Download it and open it directly in the game.

Explore more