Jump to content

Recommended Posts

Posted
package com.ModdingMinecraft.blocks;


import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraftforge.common.ToolType;

public class BlockTrampoline extends Block {

    private static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0, 0, 0, 1, 0.0625 * 8, 1);
    private static final VoxelShape SHAPE = Block.makeCuboidShape(0.0d, 0.0d, 0.0d, 16.0d, 7.0d, 16.0d);

    public BlockTrampoline() {
        super(Block.Properties.create(Material.WOOL)
                .jumpFactor(10)
                .sound(SoundType.CLOTH)
                .harvestTool(ToolType.AXE)

        );
    }

    @Override
    public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
        return SHAPE;
    }

    @Override
    public boolean isSlimeBlock(BlockState state) {
        return true;
    }
    
}

 

 

I put isSlimeBlock return true but it didn't work. Is there another command I'm supposed to be using?

Posted (edited)

What are you actually trying to achieve for the players?

If you want a slime block, register a new SlimeBlock.

Edited by Alpvax
Posted
10 minutes ago, Help! said:

What argument am I supposed to pass into it?

Learn basic Java, then come back. Don't learn Java as you mod, even if you succeed in what you're doing that way (you probably won't) if you plan to work on the mod a more than a week you're most likely going to rewrite the entire mod after seeing your older code. As diesieben stated take a look at SlimeBlock, everything you need is there.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Posted
20 hours ago, Novârch said:

Don't learn Java as you mod, even if you succeed in what you're doing that way (you probably won't)

Watch me

Posted
17 minutes ago, Help! said:

Watch me

I'm not saying it's impossible to make a mod while learning Java, I just think it's much easier to mod after you've polished your Java fundementals. For instance, if you already knew Java, you would have never posted this. You would have looked at SlimeBlock and seen what makes it bouncy, and copied it, or instantiated your block as a SlimeBlock, etc. You'll have a much better time modding if you learn Java first.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

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.