Jump to content

JKCTech

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by JKCTech

  1. do you mean it has to be the exact item? because i tried to extend the ItemWritableBook Class but still the same result, and if it has to be the ItemWritableBook item, how do i create a custom dupe?
  2. do you mean it has to be the exact item? because i tried to extend the ItemWritableBook Class but still the same result, and if it has to be the ItemWritableBook item, how do i create a custom dupe?
  3. 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)
  4. 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)
  5. I've tried the method of this classes: https://github.com/rockysims/fortressmod/tree/master/src/main/java/com/newyith/fortressmod/items but since they are form end-2014 i didn't expected much. so either i messed up somewhere, or this method doesnt work anymore. (considering the fact that the WrittenBook.Class no longer exists )
  6. i tried to, but it didn't seem to work for some reason so either i used the wrong method, OR i used the wrong tags, OR i messed up somewhere else... i tried an example from another mod [1.7] but the WrittenBook class is no longer a thing
  7. Add this to your code to apply the texture: Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new net.minecraft.client.resources.model.ModelResourceLocation(References.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory")); hope it works
  8. Hey guys, I'm working on a big mod here, wrote about 10 custom mobs, 10 custom blocks, but when the items occur, i get stuck I want to give a player a custom written book with some pages of text in it but I can't seem to get it working. I've tried writing some NBT tags but that didn't seem to work (Or i messed up) Is there a way to let the player get an item from the creative menu (so really a custom item) and when the rightclick executes, it opens up a hard-coded text? the item itself is already added to the menu etc. but i want it to have the text in it... can you guys help me out? thanks
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.