My Block class now looks like this:
public class SuperSlimeBlock extends BreakableBlock {
public SuperSlimeBlock() {
super(Block.Properties.create(Material.CLAY, MaterialColor.GRASS).
slipperiness(0.8F)
.sound(SoundType.SLIME)
.notSolid()
);
setRegistryName("super_slime_block");
}
@Override
public boolean isSlimeBlock(BlockState state) {
return true;
}
@Override
public boolean isStickyBlock(BlockState state) {
return true;
}
public void onFallenUpon(World p_180658_1_, BlockPos p_180658_2_, Entity p_180658_3_, float p_180658_4_) {
if (p_180658_3_.isSuppressingBounce()) {
super.onFallenUpon(p_180658_1_, p_180658_2_, p_180658_3_, p_180658_4_);
} else {
p_180658_3_.onLivingFall(p_180658_4_, 0.0F);
}
}
public void onLanded(IBlockReader p_176216_1_, Entity p_176216_2_) {
if (p_176216_2_.isSuppressingBounce()) {
super.onLanded(p_176216_1_, p_176216_2_);
} else {
this.func_226946_a_(p_176216_2_);
}
}
private void func_226946_a_(Entity entity) {
Vec3d lvt_2_1_ = entity.getMotion();
if (lvt_2_1_.y < 0.0D) {
double lvt_3_1_ = entity instanceof LivingEntity ? 1D : 0.8D;
entity.setMotion(lvt_2_1_.x, -lvt_2_1_.y * lvt_3_1_, lvt_2_1_.z);
}
}
public void onEntityWalk(World p_176199_1_, BlockPos p_176199_2_, Entity p_176199_3_) {
double lvt_4_1_ = Math.abs(p_176199_3_.getMotion().y);
if (lvt_4_1_ < 0.1D && !p_176199_3_.isSteppingCarefully()) {
double lvt_6_1_ = 0.4D + lvt_4_1_ * 0.2D;
p_176199_3_.setMotion(p_176199_3_.getMotion().mul(lvt_6_1_, 1.0D, lvt_6_1_));
}
super.onEntityWalk(p_176199_1_, p_176199_2_, p_176199_3_);
}
}
Now it works. But this confuses me because I copied the exact properties of the vanilla slime block into my block class and it didnt have the notSolid(). Why doesnt the vanilla block need the notSolid()?
Edit:
I still had old files from Forge 1.14. So I copied the properties there.
Apparently "notSolid" its something new that came with 1.15