Started by
VolcanoBoy
on
Topic category: Help with Minecraft modding (Java Edition)
I make a custom log and a custom leaves, and i make a biome with this custom tree, but the leaves start decay around the custom log. what is the option? (bad english, i'm hungarian)
i got the code:
@Override public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos){
return true;
}
If it doesn't work, let me know.
Where do I put this?
Where would this code be put??
Bump
The block class.
That would be great if I could edit comments, but I'm actually not sure where in the block class either.
You could just add "logs" tag to your logs and "leaves" tag to your leaves. After you do this, it must stop decaying.
How do we add "logs" tag?
Why is this not automatically done with MCreator? Shouldn't this be a feature?
I can add "logs" tag just fine but for "leaves" tag I get error message: "Do not use vanilla names, this can cause build problems!"
Minecraft 1.12 and up (i think) use tags to do a lot of things. Create a tag called whatever you want really, 'logsTag' would work
Set the registry name to 'logs', namespace to 'minecraft' and tag type to 'blocks'. Then set your custom log/s in the tag.
You DO NOT need a leaves tag, the leaves element in the block editor is enough.
This bit isn't important for your question just giving you some context:
Minecraft uses tags (in this particular instance) to check if the block it is next to is valid. So the leaves will go 'hey, are there any blocks under the logs tag nearby to prevent me from decaying?' and if there is a block under the tag, it will not decay. You can do this is datapacks too, if you add stone for example under the logs tag, stone becomes a 'log'.
If you want your logs to be used in vanilla recipes, like campfires, duplicate the tag element and change the tag type to items. And boom! you're done
Ok, thanks :)
I've tried this but it doesn't work ):