Jump to content

[Solved][1.16.5] Colored Item with block model


DavidQF555

Recommended Posts

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
Link to comment
Share on other sites

{
	"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
Link to comment
Share on other sites

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? 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 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...

×   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.