I wanted to rewrite torchflower block to act as a dead bush (so it can be placed on sand and generate in deserts).
I found some mention that registry override doesn't work, but didn't pay much attention to it.
let $MapColor = Java.loadClass("net.minecraft.world.level.material.MapColor")
let $PushReaction = Java.loadClass("net.minecraft.world.level.material.PushReaction")
let $BlockBehaviour$OffsetType = Java.loadClass("net.minecraft.world.level.block.state.BlockBehaviour$OffsetType")
let $SoundType = Java.loadClass("net.minecraft.world.level.block.SoundType")
let $BlockBehaviour$Properties = Java.loadClass("net.minecraft.world.level.block.state.BlockBehaviour$Properties")
let $DeadBushBlock = Java.loadClass("net.minecraft.world.level.block.DeadBushBlock")
StartupEvents.registry("block", event => {
event.createCustom("minecraft:torchflower", () => {
let flower = new $DeadBushBlock(
$BlockBehaviour$Properties.of().lightLevel((bl) => 15).noCollission().instabreak().sound($SoundType.GRASS).offsetType($BlockBehaviour$OffsetType.XZ).pushReaction($PushReaction.DESTROY)["mapColor(net.minecraft.world.level.material.MapColor)"]($MapColor.PLANT)
);
return flower;
});
});
nothing has changed, but also the game didn't crash or give an error?