Posted February 24, 20214 yr I have created a new slime block and it extends the SlimeBlock class, so why doesn't it work with pistons like a normal slime block does? It doesn't pull blocks with it, or bounce the player when it hits them being pushed by the piston. The player bounces fine when landing on it, but that is it. The Class: package com.nulldev.modbase.blocks; import net.minecraft.block.AbstractBlock; import net.minecraft.block.SlimeBlock; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class PinkSlimeBlock extends SlimeBlock { public PinkSlimeBlock() { super(AbstractBlock.Properties.create(Material.SPONGE).hardnessAndResistance(0, 1)); } @Override public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance) { double x = entityIn.getMotion().getX(); double y = entityIn.getMotion().getY() * 1.75; double z = entityIn.getMotion().getZ(); entityIn.setMotion(x, y, z); super.onFallenUpon(worldIn, pos, entityIn, fallDistance); } } Edit: I have also tried adding this: @Override public boolean isSlimeBlock(BlockState state) { return true; } It changed nothing Edited February 24, 20214 yr by NullDev
February 24, 20214 yr Besides IForgeBlock.isSlimeBlock() there is also IForgeBlock.isStickyBlock() and IForgeBlock.canStickTo() that you might need to override.
February 24, 20214 yr Author 11 hours ago, vemerion said: there is also IForgeBlock.isStickyBlock() and IForgeBlock.canStickTo() that you might need to override. I have overriden both of them and nothing has changed. They both always return true. @Override public boolean isStickyBlock(BlockState state) { return true; } @Override public boolean canStickTo(BlockState state, BlockState other) { return true; }
February 24, 20214 yr Author Does this git repo generated by IntelliJ work? That's the only way I know how to make a git repo of it. .git.zip
February 24, 20214 yr Author 6 minutes ago, diesieben07 said: I need an URL I can clone. https://github.com/AyliasTheCoder/The-Secrets-Of-BlocksDrawing
February 24, 20214 yr Author Turns out it was a problem with IntelliJ. Not sure what, but I restarted it and everything is working fine now.
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.