KubeJS

KubeJS

69M Downloads

The item version of colored custom blocks is not colored

Filostorm opened this issue ยท 4 comments

commented

Minecraft Version

1.18.2

KubeJS Version

1802.5.4-build.533

Rhino Version

1802.1.14-build.209

Architectury Version

4.8.79-forge

Forge/Fabric Version

Forge 40.1.68

Describe your issue

A custom block with changed color does not show the color when in item form.

onEvent('block.registry', event => {
  event.create('titanium_sheetmetal').color(0, 0x3d5ab3)
})

2022-08-12_14 40 45

Crash report/logs

No response

commented

Bump. I'm adding tons of auto generated blocks, would be super awesome if they displayed properly

commented

pretty sure you can do <block>.item(item => item.color());, or something along those lines. I highly recommend using ProbeJS, gives some autocomplete stuff in VSCode.

commented

That works! Thank you!

commented

KubeJS could automatically register an item colour handler for a block ifhone isnt already present, but that could cause issues if in the future KubeJS allows registering colour handlers that use the context, as context like position and level may not always be available for the item. In those cases a default would probably be needed.