#Custom ores
12 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Take a Look at this #1116974643983695972 message
[➤](#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())
})
})
})
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.
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
what is the replacement of "onEvent('postinit', " in 1.19.2?
StartupEvents.postInit
BlockEvents.modification