Jump to content

[1.9.4][Unsolved] Generate flowers


Recommended Posts

    public boolean generate(World worldIn, Random rand, BlockPos position) {
        for (int i = 0; i < 20; ++i) {
            BlockPos blockpos = position.add(rand.nextInt( - rand.nextInt(, rand.nextInt(4) - rand.nextInt(4),
                    rand.nextInt( - rand.nextInt();
            if (blockpos.getX() > 0 && blockpos.getY() > 0 && blockpos.getZ() > 0 && blockpos.getY() < 255) {
                if (worldIn.isAirBlock(blockpos) && (!worldIn.provider.getHasNoSky())
                        && this.flower.canBlockStay(worldIn, blockpos, this.state)) {
                    worldIn.setBlockState(blockpos, this.state, 2);

        return true;


Where are you calling this method?


Also, this.flower.canBlockStay(worldIn, blockpos, this.state), what is it actually looking for and in what direction?

Link to comment
Share on other sites

Don't bump your thread so often.


In the world generator, you can set the minimum height.

You also can set, what block to replace, and you can check in the flower class, if it can stay on the block it was generated on.


So now go and fix your bug!

Link to comment
Share on other sites

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.

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.


  • Create New...

Important Information

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