Hey so i've been having some issues with overwriting blocks, for my modpack and all that 😅 . Basically i'm attempting to change some properties of the Weather Forecast block, added by the Weather2 Mod (Weather and Tornados mod)
I've created a new startup script that does the following ->
// priority: 0
// CLIENT SIDE ONLY
// credits: aurora_luciri, from Vulpin Skies
console.info('Setting up custom Weather blocks');
const $ItemBlockRenderTypes = Java.loadClass('net.minecraft.client.renderer.ItemBlockRenderTypes');
const $RenderType = Java.loadClass('net.minecraft.client.renderer.RenderType');
const $Blocks = Java.loadClass('weather2.WeatherBlocks');
const $ForecastBlock = Java.loadClass('weather2.block.ForecastBlock');
StartupEvents.registry("block", (event) => {
event.create('weather2:weather_forecast')
.hardness(2.0)
.resistance(6.0)
.notSolid()
.requiresTool(true)
//.box(0, 0, 0, 16, 32, 16, false)
})
StartupEvents.postInit((event) => {
$ItemBlockRenderTypes['setRenderLayer(net.minecraft.world.level.block.Block,java.util.function.Predicate)']($Blocks.BLOCK_FORECAST.get(), renderType => {
return (renderType == $RenderType.cutout())
});
})
It should render the block model as a cutout + change some of its properties yk, but every time i do this, it breaks the block's functionality, which's when you right click it, it gives you some valuable feedback on the weather around you, chances of tornados, etc...
Here's a video i've asked a friend of mine to record and edit (he chose to hide his discord id idk why but yeah) -
https://www.youtube.com/watch?v=0EzmqdTR2XU
I've took most of my references from this post: https://discord.com/channels/303440391124942858/1143589372462121000 , but we've been unsuccessful in finding the root cause of the problem, mainly because, we get nothing on logs 😦