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

I wanted to create a colored Item based on the item's NBT tag data, so I used an IItemColor, which worked well. However, I changed the item's model to that of a block model: 

{
  "parent": "block/cube_all",
  "textures": {
    "all": "modid:item/custom_item"
  }
}

Now, the item is not being colored. How can I color the item model with the NBT tag data? I'm storing DyeColor IDs in the NBT tag to read in the IItemColor instance. 

Edited by DavidQF555

{
	"ambientocclusion": false,
	"textures": {
		"all": "block/water_still"
	},
	"elements": [
		{
			"name": "water",
			"from": [2, 1, 2],
			"to": [14, 12, 15],
			"rotation": {"angle": 0, "axis": "y", "origin": [10, 9, 10]},
			"color": 4,
			"faces": {
				"north": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "north"},
				"east": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "up"},
				"south": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "south"},
				"west": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "west"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "up"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "down"}
			}
		}
	]
}

smth like it

Edited by WildTan

  • Author
50 minutes ago, WildTan said:

{
	"ambientocclusion": false,
	"textures": {
		"all": "block/water_still"
	},
	"elements": [
		{
			"name": "water",
			"from": [2, 1, 2],
			"to": [14, 12, 15],
			"rotation": {"angle": 0, "axis": "y", "origin": [10, 9, 10]},
			"color": 4,
			"faces": {
				"north": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "north"},
				"east": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "up"},
				"south": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "south"},
				"west": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "west"},
				"up": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "up"},
				"down": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "down"}
			}
		}
	]
}

smth like it

I mean an item that tints the texture under certain conditions like dyed leather armor but I'm trying to use a block model for an item. IItemColor usually works for normal item models but it isn't working for my item with a block model. Is there some solution to this or should I be doing something else? 

  • Author
1 hour ago, diesieben07 said:

To be tinted your model face needs to have a tintindex set (not -1, which is the default and means "do not tint"). block/cube_all has no tintindex set for any of its faces - as such your model does not get tinted.

yeah that works, thanks

  • DavidQF555 changed the title to [Solved][1.16.5] Colored Item with block model

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.