NBTTagCompound compound = new NBTTagCompound(); compound.setInteger("health", 10); int health = compound.getInteger("health"); System.out.println("Health: " + health); // Health: 10In this example, we create a new NBTTagCompound, add an integer tag called "health" with a value of 10, and then retrieve the value of this tag using the "getInteger" method. The package library for this code is "net.minecraft.nbt".