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

Hello there,

 

I've been restarting to learn mod development, and after diving into the horrendous forge documentation, I started searching for tutorials and mods hosted on git hosters, to try to create a simple mod.

 

The thing is: I have an Item, a .json model stored under my {modid}/models/item/ and a .png texture file, under {modid}/textures/items/

 

When loading the mod, I get this error.

 

This is my folder structure: folder structure.txt

 

And my sourcecode (including gradle files) is available here

 

Note that due to some weird bug, I can't paste anything on this website. That includes sourcecode, so I must use external code hosting solutions.

"Everybody has a test environment. Some are lucky enough to have a completely separate environment to run production on"

  • Author
1 hour ago, Leviathan143 said:

I believe item/block model registration needs to be done during preinit, you are doing it during init.

I forgot about that, I changed that, but now I get this item rendering, which I don't understand.

While fixing, I also changed the registerRender class to use the registryName of the item instead of a fixed name (which was for testing).

 

I now get this item rendering:

In-game screenshot of item rendering.

2017-05-01_22.56.50.png

Edited by Artemix
adding screenshot

"Everybody has a test environment. Some are lucky enough to have a completely separate environment to run production on"

 

2 minutes ago, Artemix said:

I forgot about that, I changed that, but now I get this item rendering, which I don't understand.

While fixing, I also changed the registerRender class to use the registryName of the item instead of a fixed name (which was for testing).

 

I now get this item rendering:

In-game screenshot of item rendering.

Post the latest console log, it should give the error.

  • Author

The error log is here.

 

It says that the path "metricsmod:models/item/tape_meter.json" can't be found, which I don't understand, as that's pretty much the only way to load it. That, or I missed something.

 

The json model file stored under assets/metricsmod/models/item/tape_meter.json contains

Quote

{
    "parent": "item/generated",
    "textures": {
        "layer0": "metricsmod:items/tape_meter"
    }
}

 

Edited by Artemix
adding json

"Everybody has a test environment. Some are lucky enough to have a completely separate environment to run production on"

Would you show a screenshot of the path and file as see in Windows File Explorer?

(or equivalent on your system)

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

Here's a screenshot from the file explorer/terminal, with full path.

Here's a `tree` view starting from the src/main folder:

Quote

> $ tree                                [±master ●●]
.
├── java
│   └── xyz
│       └── artemix
│           └── mc
│               └── metrics
│                   ├── ClientProxy.java
│                   ├── CommonProxy.java
│                   ├── Constants.java
│                   ├── init
│                   │   └── ItemHandler.java
│                   ├── items
│                   │   └── ItemTapeMeter.java
│                   ├── MetricsMod.java
│                   └── MetricsModTab.java
└── resources
    ├── assets
    │   └── metricsmod
    │       ├── blockstates
    │       ├── lang
    │       │   └── en_US.lang
    │       ├── models
    │       │   ├── block
    │       │   └── item
    │       │       └── tape_meter.json
    │       └── textures
    │           ├── block
    │           └── items
    │               ├── tape_meter.png
    │               └── tape_meter.xcf
    └── mcmod.info

18 directories, 12 files

 

 

Screenshot from 2017-05-02 15-53-47.png

Edited by Artemix
adding screenshot

"Everybody has a test environment. Some are lucky enough to have a completely separate environment to run production on"

  • Author

Any thoughts ?

"Everybody has a test environment. Some are lucky enough to have a completely separate environment to run production on"

Some issues I had was that I first created the files with a uppercase name, and windows didn't recognize that there was a change even though it displayed it.
Might be the same issue for you, even though it looks like you are using linux and I am not sure if thats an issue in it too.

Is the file visible in Eclipse's Package Explorer? If it isn't, try refreshing the folder or the project.

 

In my experience, Eclipse seems to cache the project. If you edit a file in Eclipse, the cache is updated and you don't notice anything. If you edit or create a file in the project folder with an external tool, the cache is not updated and the cached version of the file is used when running or debugging, leading to unexpected results.

 

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.