#Color in the custom block isn't shown in the inventory, but is shown in the world

4 messages · Page 1 of 1 (latest)

next whale
#
const metals = [
    ['tungsten', '#333333', true],
    ['tungstensteel', '#5e5e5e'],
    ['platinum', '#9bd2e8', true]
];

StartupEvents.registry("item", e => {
    for (let i of metals) {
        e.create(`${i[0]}_ingot`).texture(`minecraft:item/iron_ingot`).color(0, i[1]).tag(`forge:ingots`).tag(`forge:ingots/${i[0]}`);
        e.create(`${i[0]}_nugget`).texture(`minecraft:item/iron_nugget`).color(0, i[1]).tag(`forge:nuggets`).tag(`forge:nuggets/${i[0]}`);
    };
});

StartupEvents.registry("block", e => {
    for (let i of metals) {
        e.create(`${i[0]}_block`)
            .textureAll(`minecraft:block/iron_block`)
            .color(0, i[1])
            .hardness(6)
            .tagItem(`forge:storage_blocks`)
            .tagItem(`forge:storage_blocks/${i[0]}`)
            .tagBlock(`minecraft:mineable/pickaxe`) 
            .tagBlock(`minecraft:needs_iron_tool`)
            .requiresTool(true);
        if (i[2] == true) {
            e.create(`${i[0]}_ore`)
                .hardness(6)
                .tagItem(`forge:ores`)
                .tagItem(`forge:ores/${i[0]}`)
                .tagBlock(`minecraft:mineable/pickaxe`) 
                .tagBlock(`minecraft:needs_iron_tool`)
                .requiresTool(true);
        };
    };
});
wide pilotBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

olive spindle
#

You have to do .item(i => i.color(0,0xYourColor) to change the item color

next whale
#

I see thank you