this is my current item class:
package nl.JKCTech.fnaf.items;
import java.util.ArrayList;
import java.util.List;
import com.google.common.collect.Lists;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBook;
import net.minecraft.item.ItemFireworkCharge;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemWritableBook;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class Manual extends ItemBook {
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack stack)
{
return true;
}
@Override
public void onUpdate(ItemStack itemstack, World world, Entity entity, int metadata, boolean bool)
{
System.out.println("FIRED Update");
if (itemstack.getTagCompound() == null)
{
System.out.println("IF = Y");
itemstack.setTagCompound(new NBTTagCompound());
itemstack.getTagCompound().setString("author", "JKCTech");
itemstack.getTagCompound().setString("title", "Test");
} else {
System.out.println("IF = N");
}
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
System.out.println("FIRED onRIghtClick");
par3EntityPlayer.displayGUIBook(par1ItemStack);
return par1ItemStack;
}
}
i've added some debug stuff as well, when receiving the item, the console outputs:
when i right-click, the event also fires.
but just nothing happens...
i'm getting really confused.
i also checked the nbt data of both items, the data IS written, but it just doesn't get recognised as a book....
the only difference between the 2 is the item ID, and the fact my item doesn't contain pages (yet) since i don't exactly now how to do that... (Would also be of help)