"Is block replaceable?" option for blocks and plants

Upvotes: 4
Issue description

Some vanilla blocks, such as snow layer and dead bush, can be replaced just by placing a block instead of having to break them first. (This behavior is also applied by choosing certain materials, but this can't be done for plant elements)
The required code is

@Override
		public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos)
    	{
       		return true;
    	}

 

Issue comments

Submitted by Klemen on Fri, 05/17/2019 - 16:09

Nice request and thanks for the code sample. We will consider adding this.

Submitted by TCPMModer on Wed, 05/22/2019 - 21:32

If I wanted my block to do this what would I replace?

You probably should have some Java experience, but just throw it in any place that you see more of these blocks being defined...