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,

Indescriptive title aside I currently need help with 2 things. The first one is most likely something easy to fix and I'm just to stupid right now. I got the famous black-purple texture displayed as my block texture, but the block itemstack is showing the correct texture tho. Here are the blockstate and model file:

Spoiler

model:
 



{
  "parent": "minecraft:block/template_glazed_terracotta",
  "textures": {
    "pattern": "minecraft:block/essence_block_darkness"
  }
}

blockstate:



{
  "variants": {
    "facing=east": {
      "model": "elementalcombat_weaponry:block/essence_block_darkness",
      "y": 270
    },
    "facing=north": {
      "model": "elementalcombat_weaponry:block/essence_block_darkness",
      "y": 180
    },
    "facing=south": {
      "model": "elementalcombat_weaponry:block/essence_block_darkness"
    },
    "facing=west": {
      "model": "elementalcombat_weaponry:block/essence_block_darkness",
      "y": 90
    }
  }
}

The block should behave the same as the glazed_terracotta. So what am I missing?
Also here is a link to directory in my git repository:
https://github.com/Tavi007/ElementalCombat-Weaponry/tree/main/src/main/resources/assets/elementalcombat_weaponry

My second problem is about the build.gradle file. I finished another mod, which is a library mod. Before I try to upload it to Maven Central, I would like to test it first by importing it into my test project. Since I got the jar locally I added

implementation fg.deobf(files('C:/Minecraft Modding/ElementalCombat/build/libs/elementalcombat-forge-1.16.5-1.1.1-api.jar'))

to the dependencies section of the build.gradle file. This does add the jar as library, but I run into a FieldNotFound exception on startup. The missing field has an obfuscated name, so I don't really know, what is missing. All I know is in which line the error occures and it's this one: https://github.com/Tavi007/ElementalCombat/blob/b562cba34d2bee7a647aa4d088372c917d67a3d4/src/main/java/Tavi007/ElementalCombat/init/EnchantmentList.java#L39

Do I get the error, because the minecraft mapping wasn't applied correctly? Or is it due to something completly different? I'm at a complete loss here. :/

And here is the link to the gradle file: https://github.com/Tavi007/ElementalCombat-Weaponry/blob/main/build.gradle
(It currently only uses the api jar, because this way I can keep working on it.)

Edited by Tavi007

"pattern": "minecraft:block/essence_block_darkness"

I don't think the minecraft namespace has block/essence_block_darkness

  • Author

You are right. I forgot to revert it back (I was testing, if minecraft:block/stone was working, which it was not. I had the same problem: itemstack is looking fine (display a stone block), but the actual block was missing its texture). I changed the namespace to elementalcombat_weaponry, which should be the correct one. Sadly the issue with the texture persist.

Edited by Tavi007

I believe the problem is because in your code you assign ESSENSE_BLOCK_DARKNESS to a new Block(), which does not have directionality, and so none of the variants in your blockstates definition will ever apply.

In order to fix this, you probably want to create a class for your blocks that extends HorizontalBlock (take a look at the GlazedTerracottaBlock class as an example), and in the register method, use that class instead of Block.

Edited by A Soulspark

  • Author

You are completly right. Swapping Block to GlazedTerracottaBlock fixed the problem (No need to create a new Block type, since the block should behave excatly like the terracotta block anyway). Thank you!

Edited by Tavi007

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.