diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtFactory.java b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtFactory.java
index 0d72c602..97339f97 100644
--- a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtFactory.java
+++ b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtFactory.java
@@ -113,6 +113,22 @@ public class NbtFactory {
}
}
+ /**
+ * Set the NBT compound tag of a given item stack.
+ *
+ * The item stack must be a wrapper for a CraftItemStack. Use
+ * {@link MinecraftReflection#getBukkitItemStack(ItemStack)} if not.
+ * @param stack - the item stack.
+ * @param compound - the new NBT compound.
+ */
+ public static void setItemTag(ItemStack stack, NbtCompound compound) {
+ if (!MinecraftReflection.isCraftItemStack(stack))
+ throw new IllegalArgumentException("Stack must be a CraftItemStack.");
+
+ StructureModifier> modifier = getStackModifier(stack);
+ modifier.write(0, compound);
+ }
+
/**
* Construct a wrapper for an NBT tag stored (in memory) in an item stack. This is where
* auxillary data such as enchanting, name and lore is stored. It doesn't include the items
@@ -127,16 +143,7 @@ public class NbtFactory {
if (!MinecraftReflection.isCraftItemStack(stack))
throw new IllegalArgumentException("Stack must be a CraftItemStack.");
- Object nmsStack = MinecraftReflection.getMinecraftItemStack(stack);
-
- if (itemStackModifier == null) {
- itemStackModifier = new StructureModifier