Jump to content

Recommended Posts

Posted

Hello,

I'm a new modder, I don't have real knowledge on mod, and I have real problem with a function of Forge.

When I ty to create a new block and define a Material, this last one is totally ignored by the game.

I explain : If I create a block which as for Material "sand", it reacts like a basic block (sound of the stone, no falling, and all is effective on it, not only the shovel). It is the same for all material in Minecraft.

I showed and read a lot of tutorials but everybody do the same error, and they don't seem to take care about this problem... whereas it's very important, I think.

Here is an example :

 

In my principal mod file I declared the bloc : "sandofpath" and initialized it like this :

sandofpath = new BlockwwrpSand(Material.sand).setBlockName("sandofpath").setCreativeTab(wwrpTab).setBlockTextureName(modid + ":" + "sandofpath");
GameRegistry.registerBlock(sandofpath, "sandofpath");

 

Here's the class of the block (BlockwwrpSand) :

package wwrp.Blocks;

import java.util.Random;

import wwrp.Common.Modwwrp;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFalling;
import net.minecraft.block.material.Material;

public class BlockwwrpSand extends BlockFalling 
{

public BlockwwrpSand(Material material)
{
super(material);
}
}

 

I tried a lot of solution but they don't work at all.

Material seems to be realy ignored by Forge 1.7.

Do you have a solution to fix it ?

 

Thank you in advance.  :(

Posted

Material doesn't have the effects you think.

"sand" in particular does nothing but having a specific note from the note block, and display "sand color" on the map (MapColor)

 

There are also "burning", "pushing", "tool use" flags in Material, but "sand" uses the defaults.

Posted

Alright, I though the material.sand enable the block to have the same function as sand.

So, how can I make the bloc have the same proprieties ?

I mean, the falling, the shovel which is more effective on it than other tools, the stepsound, ... ?

I have to encode all the proprieties one by one on the class of my block ?

Posted

Most of those properties can be defined at block initialization.

Extend BlockFalling to get a basic falling block, then use the setters to add other properties.

Block#setStepSound(SoundType)
Block#setHardness(float)

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.