This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NBTEditor { | |
public static ItemStack setNBTValue(ItemStack is, String path, String value) { | |
path = "null." + path; | |
String[] pathArray = path.split("\\."); | |
pathArray[0] = null; | |
net.minecraft.server.v1_16_R3.ItemStack nms = CraftItemStack.asNMSCopy(is); | |
NBTTagCompound[] nbts = new NBTTagCompound[pathArray.length - 1]; | |
for (int i = 0; i < pathArray.length; i++) { | |
String part = pathArray[i]; | |
if (i == 0) { |