Posted February 10, 201510 yr Hey guys, been working on a simple mod with my son and I am bit stuck trying to create a custom bone item "Bloody Bone". I started just creating a new item of that name but realized it didn't have all the base behaviors of a bone. I looked around for an bone class that derives from the Item type but couldn't find one. I did find the ItemFood class which seems to have the methods in them for allowing a wolf to eat it but I'm still confused why I can't find a class for the bone item. I did find the registry for the bone item in the item.class but I would think there would need to be some more code somewhere to define the behaviors and such. Sorry if I am missing something basic here I am pretty new to this. Any help would be greatly appreciated.
February 10, 201510 yr I believe that a "Bone" item is simply an instance of Item which is given the parameters to make it look like a bone, so there isn't any logic for bone, rather logic that uses the bone item. itemRegistry.addObject(352, "bone", (new Item()).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc).setTextureName("bone")); I require Java, both the coffee and the code
February 10, 201510 yr If you want it to be eaten by wolves I think you have to extend ItemFood then pass 3 parameters to the super: heal amount (an int), saturation (a float), and wolf food (a boolean). the "wolf food" boolean is what you want. But on the other hand, if extend ItemFood player will also be able to eat it (Eeww. Bloody bones for dinner?). So it's your call.
February 10, 201510 yr Author Belpois, thanks I see you what you mean. I see the code in the EntityWolf class in the interact method. That method on the ItemFood class made me think that wolf tame behavior was implemented using that. Awesome_Spider, ya I think I will try and keep the behavior similar to the vanilla bone item. I am thinking I will need to inherit from EntityWolf and then override the interact method. Just started learning java so need to go play around with it some. Thanks for the quick replies!
February 11, 201510 yr deadrecon98, that looks like exactly what I am looking for. Thanks! Any time, just let me know if you need help.
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.