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 have now employed quite a few "days" with Java. Now I am working on Minecraft mods. My first mods are now finished and work fine with no errors. (many new items, blocks, crafting recipes ....)

 

My next idea is the melons blocks on "Hopper" grow.

Since I still have difficulties in implementing how to begin there.

 

Can I use "Forge" simply override the melons class, or change it? If so, how?

 

 

BlockStem.java:

 

[....]
/**
     * is the block grass, dirt or farmland
     */
    protected boolean canPlaceBlockOn(Block ground)
    {
        return ground == Blocks.farmland;
    }
[....]

 

 

The search API was not really helped (and also in the forum or google).

Maybe I've also just looking for the wrong, who knows.

 

Thanks for the help.

Greetings from Germany

 

PS: Sorry for the bad english ... Google's fault: D :o:P

You can't directly replace whole class without using ASM.

You can replace registry, but them you will create huge incompatybility.

 

Best way is to utilize events.

In your case you might want to use "PlaceEvent". Google on how to use Forge events.

 

Write what exacly do you need for more help.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

Okay it works.. it was a fail in eclipse..

 

Now, the discription of the event ist:

 

 

net.minecraftforge.event.world.BlockEvent.PlaceEvent

@Cancelable

Called when a block is placed by a player. If a Block Place event is cancelled, the block will not be placed.

 

Player? melon_block is set by melon_stam ? or not?

 

My next idea is the melons blocks on "Hopper" grow.

 

I don't understand what you want.

 

Write what exacly do you need for more help.

1.7.10 is no longer supported by forge, you are on your own.

@Ernio He wants to change the way melons blocks behave, which is not necessarily only when placed by players, but when they grow from stems.

 

@OP I'm not sure if this will work, but you could try BlockEvent.NeighborNotifyEvent - it fires whenever a block notifies its neighbors that it has changed, and may fire for stems when they set the melon block, or perhaps for the melon block when it is first set in the world.

 

I'll leave digging around in the code / testing it up to you, but that's where I'd start.

  • Author

Hey ho,

 

the BlockEvent.NeighborNotifyEvent don't fires when stems set the melon block... i have try it.. any other ideas?

oooor you could replace the stews instead of the melons, because there is no reason the replace the behaviour of the melon. you want to change the behavior of the stews, and tell them where to put melons

Why are you wanting to grow melons on hoppers?

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Well there are many ways to do it, replace melons, replace pistons, replace hoppers, etc..

Probably your best bet would be to create a new block that acts like a hopper that allows melons to grow on them.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

  • Author

Hey,

 

okay thx i will test it..

I thought it is the stem that prevents the melon block to set it on the top of the hopper... on creativ i can manualy place a melon block on the top of the hopper... only in surrival the stem dont place the melon block on a hopper...

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.