Jump to content

How do i make a new sword?


zoomx19

Recommended Posts

Make the item, then override the onLeftClickEntity() function.

 

to code a sword is the on of the easiest things i make.

 

make an new itemclass for it and extends it itemsword:

 

than add these things:

 

setMaxDamage();

getDamageVsEntity();

onHitEntity();//Damage the tool when you hit an entity

onDistroyBlock(); //damage the sword when it distroy its block

and thats it.

Link to comment
Share on other sites

Make the item, then override the onLeftClickEntity() function.

 

to code a sword is the on of the easiest things i make.

 

make an new itemclass for it and extends it itemsword:

 

than add these things:

 

setMaxDamage();

getDamageVsEntity();

onHitEntity();//Damage the tool when you hit an entity

onDistroyBlock(); //damage the sword when it distroy its block

and thats it.

Or there is that. A more... elegant solution. I'll admit, I was feeling too lazy to check if ItemSword could be successfully overridden. :)

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

Make the item, then override the onLeftClickEntity() function.

 

to code a sword is the on of the easiest things i make.

 

make an new itemclass for it and extends it itemsword:

 

than add these things:

 

setMaxDamage();

getDamageVsEntity();

onHitEntity();//Damage the tool when you hit an entity

onDistroyBlock(); //damage the sword when it distroy its block

and thats it.

Or there is that. A more... elegant solution. I'll admit, I was feeling too lazy to check if ItemSword could be successfully overridden. :)

 

Yeah but there are better ways to make swords. This kind is the really basic easiest form i made.

I do think enchants do work.

And repair to.

 

zoomx19 you should really learn how to use minecraft efficent to do not ask these kind of questions.

 

I have problems too. but my real problem is. I ask a question and befor someone answer i have the anser find out bye myself.

When you see the problem try to read classes of minecraft and whats more important from other mods.

Make yourself an ModSource Lib (with all Versions from oldest to newest) thats the way i do and if i have a question i look at their source.

And in every case i find an answer. or when was my last question? i think it was something with redstone problems xD but that i find out by myself.

its only a hint^^" Thats it. Bye

Link to comment
Share on other sites

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.