Posted March 31, 201411 yr I need help making a book item for my mod's information, like items and recipes and such, and none of the mods that add a book item like this are open source. This is what I have so far: package com.budboy.am.item; import com.budboy.am.creativetab.CreativeTab; import net.minecraft.item.Item; public class ItemMagicBook extends ItemWritableBook { public ItemMagicBook() { maxStackSize = 1; setCreativeTab(CreativeTab.magicTab); setUnlocalizedName("magicBook"); setTextureName("am:magicBook"); } }
April 1, 201411 yr Author So I tried to make a gui with the Containers and GUIs tutorial on the wiki, but it says it's out of date... Here's the current code for my book: package com.budboy.am.item; import com.budboy.am.creativetab.CreativeTab; import com.budboy.am.gui.GuiIDs; import com.budboy.am.main.AncientMagicMain; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemWritableBook; import net.minecraft.world.World; public class ItemMagicBook extends ItemWritableBook { @Override public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int sideHit, float hitVecX, float hitVecY, float hitVecZ) { if (world.isRemote) { entityPlayer.openGui(AncientMagicMain.instance, GuiIDs.MagicBookGui, world, x, y, z); } return true; } public ItemMagicBook() { maxStackSize = 64; setCreativeTab(CreativeTab.magicTab); setUnlocalizedName("magicBook"); setTextureName("am:magicBook"); } }
April 1, 201411 yr It's for 1.6, but maybe this will help: https://github.com/WildBamaBoy/modjam-dec-2013/blob/master/Forge/mcp/src/minecraft/spellbound/item/ItemBookOfSpells.java
April 1, 201411 yr I need help making a book item for my mod's information, like items and recipes and such, and none of the mods that add a book item like this are open source. Tinkers Construct for 1.7.2 https://github.com/SlimeKnights/TinkersConstruct/blob/master/src/main/java/tconstruct/items/Manual.java Been meaning to look at how it works myself, but got a bigger mod to finish first.
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.