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 was just wondering how i would code my own sword cause im used to modloader coding and im kinda confused about making swords etc in forge.

would love for someone to help me ;D

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.

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.

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

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.