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

I've created my custom armor and i want it to have iron ingots as repair item. The problem is I simply don't know what should I write to get Item from vanilla game. For example for getting my custom Items I can use ItemList.ITEMNAME (I have ItemList class with all my items). But what shoul I write to get vanilla iron ingot?

Items.IRON_INGOT?

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

On of my voids, all variables are declared before it so this works good.

private ArmorMaterialList(String name, int[] durability, int[] damageReductionAmmounts, int enchantability, String equipSound, float toughness, Item repairItem)
	{
		this.name = name;
		this.durability = durability;
		this.damageReductionAmmounts = damageReductionAmmounts;
		this.enchantability = enchantability;
		this.equipSound = equipSound;
		this.toughness = toughness;
		this.repairItem = repairItem;
	}

Here in the line

reinforced_iron("reinforced_iron", new int[] {183, 249, 298, 216}, new int[] {3, 6, 7, 3}, 11, "item.armor.equip_iron", 0.0f, Items.IRON_INGOT),

Items is underlined with red

 

179356243_2019-11-24171650.thumb.png.494055b20b08d7dd69014ab9cd6f200f.png

And there is no import fixes

10 minutes ago, nenikitov said:

On of my voids

"Void" is the return type of a method. That thing is called a "method" and when it does not have a return, its return type is "void."

11 minutes ago, nenikitov said:

And there is no import fixes

import net.minecraft.item.Items;

https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderfarming/HarderFarming.java#L31

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

Hmmm. Importing did help. Weird that importing wasn't in quick fixes. Well, anyways, thanks for making it work.

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.