Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.  :(

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.

  • Author

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 ?

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)

  • Author

Okay I managed it manually.

My block is perfectly working now. :)

Thank you

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.