#Custom ores

12 messages · Page 1 of 1 (latest)

timber grail
#

Hello, I'm looking to create custom ore blocks for a list of custom metals that I have generating. I have Hex color values that I'm using to make the ingots/nuggets/blocks. I am hoping to be able to generate the ore blocks with a regular stone texture and the ore inlay being colored according to the metal's color value.

trail nestBOT
#

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

lost radish
late waspBOT
#

[➤](#1116974643983695972 message)
The multi-layer model requires you manually set the render type for the block to include both solid and translucent

let compressedBlocks = []

onEvent('block.registry', event => {
    for (let x=1;x<10;x++){
        let block = event.create(`kubejs:compressed_iron_block_${x}x`, 'basic')
        compressedBlocks.push(block)
        block.modelJson = {
            "parent": "minecraft:block/block",
            "textures": {
              "particle": "pneumaticcraft:block/compressed_iron_block"
            },
            "loader": "forge:multi-layer",
            "layers": {
              "solid": {
                "parent": "pneumaticcraft:block/compressed_iron_block"
              },
              "translucent": {
                "parent": "minecraft:block/cube_all",
                "textures": {
                  "all": `compressium:block/layer_${x}`
                }
              }
            }
          }
        }    
})

onEvent('postinit', event => {
    if (!Platform.isClientEnvironment()) return;
    const $ItemBlockRenderTypes = java('net.minecraft.client.renderer.ItemBlockRenderTypes')
    const $RenderType = java('net.minecraft.client.renderer.RenderType')

    compressedBlocks.forEach(block => {
        $ItemBlockRenderTypes['setRenderLayer(net.minecraft.world.level.block.Block,java.util.function.Predicate)'](block.get(), renderType => {
            return (renderType == $RenderType.solid() || renderType == $RenderType.translucent())
        })
    })
})
timber grail
#

I'll look into seeing how to apply that, thanks. Another question I have is the .item() property of the block registry event. I have no idea how to use this at all.

lost radish
#

What exactly do you Not understand? Like basically it allows the use of different ways the Blocks look either through placing it in a specific way or other actions. This can be achieved by using a property and configuring the blockstate File in a specific way

#

If you want to make a Block Like a furnace, in older Versions you would've needed to Go through this, now there's an easier way. By using cardinal as the second Arguments in event.create

rugged flame
#

what is the replacement of "onEvent('postinit', " in 1.19.2?

lost radish
#

StartupEvents.postInit

rugged flame
#

thanks

#

and onEvent('block.modification' please ??

lost radish
#

BlockEvents.modification