Hey guys! Im trying to replace a sappling, when its growing to a tree, with some other block.
I just cant get it to work. The tree will grow anyway.
public class TreeGrowEvent {
@SubscribeEvent
public void onTreeGrow(SaplingGrowTreeEvent e)
{
e.world.setBlock(e.x, e.y, e.z,Blocks.cactus);
e.world.addWeatherEffect(new Lighting(e.world,e.x,e.y,e.z));
}
}
My custom lightning is happening, but the block doesnt change. What am i doing wrong?
I hope someone can enlighten me!
Edit: Oh okay, i found the solution:
i had to add e.setResult(Result.DENY);