Jump to content

Recommended Posts

Posted

Look at the available methods to override in the Item class and IForgeItem interface.

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.

Posted

Why did you bother censoring a method call?

Also that is not the recommended way of setting properties, set them when you call the constructor, not in the constructor

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted
  On 12/13/2020 at 2:06 AM, Draco18s said:

Look at the available methods to override in the Item class and IForgeItem interface.

Expand  

I looked and nothing shows up when i do that i type it in and it shows up but when a place a dot nothing shows up after that

Posted
  On 12/13/2020 at 7:47 AM, Turnrp said:

I looked and nothing shows up when i do that i type it in and it shows up but when a place a dot nothing shows up after that

Expand  

your Item extends the Item class, right? the Item class implements the IForgeItem interface

and that interface provides some methods, go to the interface implementation (you can do that in your IDE) and look at the methods the interface provides

Also, don't try coding when you're really tired, go get some rest

  • Like 1
Posted
  On 12/13/2020 at 1:34 PM, kiou.23 said:

your Item extends the Item class, right? the Item class implements the IForgeItem interface

and that interface provides some methods, go to the interface implementation (you can do that in your IDE) and look at the methods the interface provides

Also, don't try coding when you're really tired, go get some rest

Expand  

Lol you right and is this in Intellij or another program cause ikm using Intellij

Posted
  On 12/13/2020 at 1:34 PM, kiou.23 said:

your Item extends the Item class, right? the Item class implements the IForgeItem interface

and that interface provides some methods, go to the interface implementation (you can do that in your IDE) and look at the methods the interface provides

Also, don't try coding when you're really tired, go get some rest

Expand  

And im in 1.16.4 if you are thinking of a differnt version

Posted
  On 12/13/2020 at 9:17 PM, Turnrp said:

I found something called IForgeContainerType? Will that help with a container im a little new to this

Expand  

That's something different

 

So, okay

you have your BackpackBase class right?

it extends the net.minecraft.Item class, which in turn extends the IForgeItem interface

 

the interface provides a few methods you can override, in the case of doing something upon right-click you have: onItemUse, and onItemRightClick

 

onItemRightClick detects any right click

onItemUse detects right clicks on blocks

 

Posted
  On 12/13/2020 at 9:33 PM, kiou.23 said:

IDE stands for Integrated Development Environment

 

Do you know Java or are you jumping into modding without prior knowledge of programming?

Expand  

Kinda but i hae done a lot of coding in the past and i really like this so im learning while im doing

Posted
  On 12/13/2020 at 9:33 PM, Turnrp said:

So i would put IForgeItem.onItemRightClick?

 

Expand  

no, you override it

your Backpack is an implementation of that interface (check out encapsulation and interfaces in Object Oriented Programming for more guidance)

 

so in your Backpack class, you can override it

(if you don't know what this means search for overriding methods in Java)

Posted
  On 12/13/2020 at 9:38 PM, kiou.23 said:

no, you override it

your Backpack is an implementation of that interface (check out encapsulation and interfaces in Object Oriented Programming for more guidance)

 

so in your Backpack class, you can override it

(if you don't know what this means search for overriding methods in Java)

Expand  

@Override? and then i what i override is the IForgeItem?

Posted
  On 12/13/2020 at 9:41 PM, Turnrp said:

@Override? and then i what i override is the IForgeItem?

Expand  

the IForgeItem method that you wish to override

 

it seems you're not so keen on how interfaces work, so you can search up OOP in Java to get a better idea of what's going on (understading OOP is really necessary for minecraft modding)

Posted
  On 12/13/2020 at 9:44 PM, kiou.23 said:

the IForgeItem method that you wish to override

 

it seems you're not so keen on how interfaces work, so you can search up OOP in Java to get a better idea of what's going on (understading OOP is really necessary for minecraft modding)

Expand  

Alright ill go find some youtujbe video or something and search that up

Posted

If you are trying to learn how to mod without knowing how to program (Java preferred, but any language), then you are going to have a lot of trouble.

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.

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.