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.

[1.21.5] The texture of the item is not loading.

Featured Replies

We need more info to help: where did you place the texture file, what have you tried, are there any errors? Is the problem that the item is black-pink checkered, meaning the texture is missing, or something else?

You need a new "items" folder at 

resources/assets/yourmodid/

there you add for every item model a .json file with the exact item/block name and fill it like this if it's an item:

{
  "model": {
    "type": "minecraft:model",
    "model": "yourmodid:item/youritem"
  }
}

and so if its a block:

{
  "model": {
    "type": "minecraft:model",
    "model": "yourmodid:block/youritem"
  }
}

There is also a generator for it you can do namy crazy things with it which replaces the previous hard coded Item Properties implementaion method (Bow pulling animation for example). https://misode.github.io/assets/item/

Hey! I noticed you're trying to register your alexandrite item and possibly set its resource location manually with setId(...). I wanted to help clarify a few things that might simplify your code and avoid errors.

The issue:

You're using setId(...) inside the item registration like this:

 

public static final RegistryObject<Item> ALEXANDRITE = ITEMS.register("alexandrite", () -> new Item(new Item.Properties().useItemDescriptionPrefix() .setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(TutorialMod.MOD_ID, "alexandrite")))));

But:

Item.Properties does not have a setId(...) method — this line will either fail or do nothing meaningful.

useItemDescriptionPrefix() is mostly used for translation keys (like "item.modid.name") but isn't needed unless you have a very specific reason.

🛠 The fix:

You only need to register your item like this:

 

public static final RegistryObject<Item> ALEXANDRITE = ITEMS.register("alexandrite", () -> new Item(new Item.Properties()));

Forge automatically handles the ResourceLocation (modid:alexandrite) based on the name passed into .register(...), so there’s no need to manually assign it.

📝 For the texture:

Make sure you have this file in your resources:

src/main/resources/assets/tutorialmod/models/item/alexandrite.json

{ "parent": "item/generated", "textures": { "layer0": "tutorialmod:item/alexandrite" } }

And your texture PNG goes here:

src/main/resources/assets/tutorialmod/textures/item/alexandrite.png

🌍 For the name in-game:

Add this to your en_us.json under:

src/main/resources/assets/tutorialmod/lang/en_us.json

{ "item.tutorialmod.alexandrite": "Alexandrite" }

 

Note: if im wrong about the issues you are encountering, i apologize.

Edited by Loghan

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.