Jump to content

How to make a custom Arrow ?


KhrBasil

Recommended Posts

Hello ,

I have been working on a Bow lately and the Final thing missing is an Arrow but there is a few problems...

1. I dont have any idea how to do that ...

2. I´d like to make it use a custom Render

3. I need help ....

 

So yeah.... If anyone can tell me how to make an Arrow with custom Rendering Id be more then Happy :D

Thanks in Advance ^^

( P.S if you could please explain it so that a noob like ...me... could understand it ^^" Thanks )

Link to comment
Share on other sites

Have you started at all?

I assume not, so first try to create a new item and get it into the game.

Then check the ItemArrow code and the original bow's code. Try to see if you can understand how it works.

Then write some code trying out things and come back here with it, if it's not working out and we will help you further :)

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

Have you started at all?

I assume not, so first try to create a new item and get it into the game.

Then check the ItemArrow code and the original bow's code. Try to see if you can understand how it works.

Then write some code trying out things and come back here with it, if it's not working out and we will help you further :)

 

Thanks...do you know where the ItemArrow is ? because either Im Blind or its not in net.minecraft.item....

Link to comment
Share on other sites

Inside the Item.java it's located on Line 46, as you see it's not much to the arrow inn it self :)

Which is fine since it's only an item and has no special code. Since you have the bow I assumed you had looked at the original bow's code. There you will find all the logic of shooting including the creation of the entity for the arrow :)

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

Let´s say that you want to make a staff that shoots i dont know balls of thunder then you first make a staff which you get from making an item and then make a custom look of the staff.

Then you write for example public class ItemStaff extends ItemBow then you´ll get an error or warning under ItemStaff if you just hover your´e mouse over it it will say add constructor.

Then click on that. Then you made your own "bow" or shooting staff. The next thing you´ll need to do is to look for an command called something like arrow or shoot or ItemArrow which you can easily fin by pressing ctrl+f and then write arrow in the box that appears and hit find. If you find it great if not then just keep looking(thats what modding is all about trial and error).

If you/ when you find it then you´ll need to make a new class or item. When your´e done making that item and you have set an image on how the ThunderBall will look then go back to your ItemStaff and change the shoot or Ammo or whatever i was called from arrow to Item.ThunderBall then you gotta write something like Item.ID i think then it should work and if you get any errors than just look at your console and see what it says or look up the error. Feel free to ask me for help.

 

Ps. I wrote something wrong don you also have to copy paste the code from ItemBow to ItemStaff and then change the shoot or ammo to Item.ThunderBall

Link to comment
Share on other sites

Or just take a look at the original bow's code, as I said above -_-'

It's easy to understand and it shows him how it's been done. Should make his learning easier and his progress to get it working faster :)

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

i had this really awesome method before.

 

I copy pasted the entire bow and EntityArrow code into new classes, chnaged names (offcourse)

 

copy the arrow renderer code too

 

register your new arrow entity in your client proxy

 

edit bow code, so it shoots your arrows

start minecraft, play around with code from arrow and bow

 

find final result after a few days, be very happy, and continue ;D

Link to comment
Share on other sites

  • 1 year later...

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.