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

I am making a block called Root Block and I want it to do the same things as a dirt block, except for plating crops but I want to be able to plant saplings on it. I can't figure out how to do this. Please Help! NOTE: I am new to modding so please tell me where to put whatever code you might send and what it does, please.

Edited by WimpyLlama

20 hours ago, WimpyLlama said:

I can't figure out how to do this.

Start by learning Java (elsewhere, there are many online tutorials), which you should be able to do in a couple weeks. Then install Forge's development system, described in detail elsewhere on this site.

 

20 hours ago, WimpyLlama said:

please tell me where to put whatever code you might send

Don't worry, you shouldn't be asking for code to be spoon fed to you, so you won't need to be told where to put any. However, what you can do (after learning Java and installing Forge) is to Google for Forge mods at GitHub. You can see code and how it's organized by successful modders.

Edited by jeffryfisher

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

  • Author

I do know a bit of JAVA and from what other people have told me is with minecraft modding it's best to just learn how to mod not learn JAVA. And yes, I did make a block, here is my code.

package wimpyllama.wimprimstuff.blocks;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import wimpyllama.wimprimstuff.Reference;

public class BlockRootBlock extends Block {
	
	public BlockRootBlock(String unlocalizedName) {
		super(Material.GROUND);
		this.setUnlocalizedName(unlocalizedName);
		this.setRegistryName(new ResourceLocation(Reference.MODID, unlocalizedName));
		this.setHardness(0.5f);
		this.setResistance(0);
		this.setSoundType(SoundType.GROUND);
	}

	@Override
	public Item getItemDropped(IBlockState state, Random rand, int fortune) {
		return Item.getItemFromBlock(this);
	}

}

 

Did you consider extending dirt instead of the generic Block class? What issues did you encounter?

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.