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

So I am trying to modify some simple aspects of Minecraft in an attempt to get a grasp of how modding works.

I wanted to do 3 things.

 

1. Make a recipe for arrows using cobblestone and planks. (Done)

 

2. Make it so that the player does not heal at full health by default.

 

3. Make it so that when an entity falls on farmland, it does not un-till.

 

Now, #1 I have managed to do in the public void that loads FML Initialization.

GameRegistry.addRecipe(new ItemStack(Item.arrow, 4), "c", "p","p",'c', Block.cobblestone, 'p', Block.planks);

 

#2 and #3 I have only managed to achieved by editing baseclasses.

 

#2:

 

net.minecraft.block.BlockFarmland

Change the onFallenUpon() to not return by placing a comment. 

public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6)

    {

        if (!par1World.isRemote && par1World.rand.nextFloat() < par6 - 0.5F)

        {

            if (!(par5Entity instanceof EntityPlayer) && !par1World.getGameRules().getGameRuleBooleanValue("mobGriefing"))

            //{return;}

            par1World.setBlock(par2, par3, par4, Block.dirt.blockID);

        }

    }

 

 

 

#3:

 

 

net.minecraft.world.GameRules

I set the gamerule introduced in 1.6 (I believe) to false, by default.

public GameRules()

    {

        this.addGameRule("naturalRegeneration", "false");

    }

 

 

 

While searching for an answer, I stumbled upon Reflection and ASM, but I understood how to use neither from the tutorials.

Any help would be super greatly appreciated. Thanks in advance, Kaz.

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.