Jump to content

[1.8] Explosion when placing a block


Recommended Posts

Because 1.7.10 isn't supported by forge anymore, I'm trying to make my block in 1.8 .

So, what ever the big difference is, I still havent found a way to do this right.

I just want to make a block that explodes instantly when you place it.

Help would be very appreciated because this is my first mod and I just know the basics about forge.




Link to comment
Share on other sites

I just completely lost...


After trying for hours I've found no way to bring that to work.

This is what I've got, and I know this doesn't work because my game crashes any time when i place the block :)

        public int onBlockPlaced(World world, final int x, final int y, final int z, final int p_149660_5_, final float hitX, final float hitY, final float hitZ, final int metadata) {
            return  world.createExplosion(null, 9D, 9D, 9D, 9F);


I just don't know what I have to fill in into this auto comleteted thing that comes up...




By the way: If you find mystakes like grammarmystakes or spellingmystakes... I'm german, my english is not the best!



Link to comment
Share on other sites

I searched the internet for onBlockPlaced.

I found an forum post about it and I thought there is no difference to between 1.7 and 1.8.

So I did it like the guy who posted this :

Would it work in 1.7.10? And how...

And I would prefer to use 1.7.10 because I'm trying to make a mod for an modpack that is still in 1.7.10.

Because 1.7.10 is not supported anymore I have to recreate the modpack in 1.8...



Link to comment
Share on other sites

8 hours ago, AforgeUser said:

return  world.createExplosion(null, 9D, 9D, 9D, 9F);


World#createExplosion returns an Explosion object. You can't use that as the return value for a method that returns an integer.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

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.

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.

  • Create New...

Important Information

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