Jump to content

Recommended Posts

Posted

I'm trying to make a biome where the top layer is snow blocks, but of course, no trees are spawning. My immediate solution is just to copy one of the existing tree classes and modify it so it can spawn on snow blocks. How do I do that? Where are the blocks it can spawn on set?

Posted

Looking at SaplingBlock from Minecraft, it extends BushBlock what has a function:
 

protected boolean isValidGround(BlockState state, IBlockReader worldIn, BlockPos pos) {
      Block block = state.getBlock();
      return block == Blocks.GRASS_BLOCK || block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL || block == Blocks.FARMLAND;
   }

 

would suggest, override this method...

 

  • Thanks 1
Posted

Worked like a charm, thanks! Fancy trees are a little more complicated but I worked them out the same way and looking at the defaultbiomefeatures.java if anyone's curious.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.