Posted August 25, 201312 yr Hi there, I have been making a custom TileEntity and the basic idea is that you put 9 Gel into the block and when 9 of those are extracted (the number increases every time after 1 is extracted) a certain item is "created". So i have it all working, but i wanted to make it so that my GUI shows the correct number so i thought of using the NBTTagCompound Read and Write to save the ammount of gel (also because i wanted it to be saved whenever you close the game etc). To see what it is writing and reading i did the following: @Override public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); System.out.println("[soul Forest] write : " + (short)this.gelAmmountExtracted); par1NBTTagCompound.setShort("Gel", (short)this.gelAmmountExtracted); // Some more code below (but thats for itemstacks) so i left it out } Now in the console i get the following values 1, 0. And whenever another gel is updated i get 2 and 0 etc. So 2 lines are being printed with 2 values and thats why my GUI picks up 0 continuesly, but how do i make it so that i don't read and write 2 values. I am the creator of the Soul Forest Mod : http://www.planetminecraft.com/mod/151-soul-forest-10-ores-vines-dimension-mobs-and-more/
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.