Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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 :)

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.

  • 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!

 

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.