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,

I'm trying to write some forge mods. I have experience with the Spigot API, but due , at my opinion, the bad documentation and tutorials, I have some problems.

I started with the tutorial by tcode2k16 and the forge documentation.

 

Now I want to create an Custom Shovel having the same stats like the iron shovel, just with other texture, name and recipe.

 

At first, I tried the following, but this didn't work, because I don't know which arguments are missing:

public static final RegistryObject<Item> MY_SHOVEL = ITEMS.register("my_shovel", () ->

            new ShovelItem(new Item.Properties().group(ItemGroup.TOOLS).addToolType(ToolType.SHOVEL, 2))

            );

 

I searched a lot, but didn't find anything beginner friendly helping me (my english  is not the best too xD ).

 

I would appreciate it, if someone could help with this problem or link some guides or a detailed documentation being up to date!

You're missing an IItemTier, float attackDamage and a float attackSpeed, all of these things are basic Java and you do not need to ask about them. Please look at the constructor, unless you're blind it has everything you need, your IDE should even give you a warning and tell you what you didn't put into the constructor. In short, please learn basic Java before modding.

Edited by Novârch

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

4 minutes ago, Koque said:

this didn't work

What exactly happened?

You can find all possible methods at net.minecraft.item.Item, in Properties inner class. Just looking through them bring me idea, that you need to specify maxStackSize or defaultMaxDamage.

Anyway, describe your problem

Everything said above may be absolutely wrong. No rights reserved.

  • Author
24 minutes ago, Novârch said:

please learn basic Java before modding.

I used Java over a year ago, but changed to Python, in addition  due to better Gradle support I changed from NetBeans to IntelliJ, so my Java knowledge is at the time only bit more than the basics.

 

23 minutes ago, Dzuchun said:

Anyway, describe your problem

The IDE tells me, there are 3 arguments missing, but nothing more. I couldn't find the Java Docs of the Forge API.

 

Quote

IItemTier, float attackDamage and a float attackSpeed

Thank you for the missing arguments.

Edited by Koque

54 minutes ago, Koque said:

The IDE tells me, there are 3 arguments missing, but nothing more. I couldn't find the Java Docs of the Forge API.

So.... go open the class definition for the class you're trying to instantiate.

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
5 hours ago, Draco18s said:

So.... go open the class definition for the class you're trying to instantiate.

Thank you for the tip, didn't know this is possible!

 

The thread is now closed for me.

Edited by Koque

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.