Jump to content

Recommended Posts

Posted

is there a new way of doing a item axe? ill list my java files here for the axe.class and the other parts its been added in.

 

the axe.class

 

  Reveal hidden contents

 

 

ModItems

 

  Reveal hidden contents

 

 

item render register

 

  Reveal hidden contents

 

 

i know my coding might not be set up the best but its what i know, everything else works but once i add the axe in the crash happens. here is the crash

 

  Reveal hidden contents

 

Posted

In order to get the axe working, you need to use the secondary constructor in ItemAxe, which is ItemAxe(ToolMaterial material, float damage, float speed).  The reason the ItemAxe(ToolMaterial material) constructor crashes is because it grabs the damage and attack speed from an array of floats relative to the index of the toolmaterial passed.  Since the array has only four elements, it crashes since you're passing a toolmaterial of index five (which you can't do anything about).

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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