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

So now that i learned about items, i wanted to make a multitool. Alright so i did everything until i got to the class multitool. I figured that all the tools except shears and sword comes from one superclass called ItemTools. So i extended that and make a constructor, but then in my Modded items class, i got an error at

multishard = new MultiShard(MultiShard)

. The error says that the constructor for my multishard class is unidentified. Please help!

Heres my ModItem class: http://pastebin.com/h3gaMezq

Heres my MultiShard class: http://pastebin.com/P8r8Av1G

 

Thanks!

~Sap

Your constructor is "protected", which means it can only be accessed by a class extending that one. Change it to public, and you should be good to go. :P

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

  • Author

Nvm I tried to make it public instead of protected, but it didnt work. Error still stayed the same. I realized that because all the other tools class are also protected, but they didnt get a constructor error.

In your MultiTool class your constructor takes three parameters:

 

protected MultiShard(float p_i45333_1_, ToolMaterial p_i45333_2_, Set p_i45333_3_)

 

When you register it, you only add one:

 

multishard = new MultiShard(MultiShard).setUnlocalizedName("multishard").setCreativeTab(MCreativeTabs.tabTools).setTextureName(RefStrings.MODID + ":MultiTool");

 

You need every parameter in order for it to run.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

  • Author

hm... alright. but im not sure how to register/identify 3... are you able to help me make the code?

Just look up a tutorial on how to make tools. When you are defining the multitool in your Main mod class, you only pass one parameter when it requires three. You could look through the ItemTool class to see how they use the float, and Set parameter you're missing.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

I'll also point out that that one parameter you're passing is the variable you're using to hold the tool item, which at that point, it is null.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Hm... Alright. With all your support im happy to say that i got my entire multitool working! Btw i defined everything in my multishard class, instead of my modded items class.

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.