Jump to content

[1.12]Destroy or Spawn Blocks


uler_pyjon

Recommended Posts

I want to create the mod that destroy or spawn blocks freely.

To reproduce destruction by right clicking a custom block, I tried following method. 

 

1.Create a custom Block, and Override onBlockActivated.

2.Create a custom Explosion class.

3.Create a custom World class, and  Override newExplosion to call the custom Explosion class.

4.In onBlockActivated,

   copy public void explode from EntityCreeper, and

   downcast worldIn(param) to the custom World class.

 

But, it is error.

 

Error Message:

net.minecraft.client.multiplayer.WorldClient cannot be cast to com.example.examplemod.CustomWorld

 

a type of worldIn is World, but there is WorldClient.

why so?

 

and,

 

Is there other best ways?

 

 

Please help me.

 

 

 

 

 

Reference Material:

https://www.youtube.com/watch?v=M5PI4KKTvPQ

 

Link to comment
Share on other sites

7 hours ago, diesieben07 said:

Why are you making a custom World class? This is almost never a good idea.

Just do the explosion from your onBlockActivated method.

Thank you for answering my questions !

 

Because I want to transform the explosion shape.

Is it possible to transform by using only param?

Link to comment
Share on other sites

Change the explosion shape -> custom Explosion class.

 

Nothing about that says "I need a custom World class"

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

8 hours ago, diesieben07 said:

Just do the explosion from your onBlockActivated method.

 

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

18 hours ago, uler_pyjon said:

To reproduce destruction by right clicking a custom block, I tried following method. 

So... I'm a little confused. What exactly are you trying to do? Do you have to blow the block up? Or do you just want to remove it?

Developer of Randores (adds 256^3 ores to the game) and Arcane Bags (adds ridiculous storage with ridiculous crafting recipes).

I know Java pretty well... So yeah...

Quote

This is where I'd put an inspirational and/or clever quote, but I can't think of one right now...

This is the output of the totally, 100% working compiler for my programming language, Planet9:

Beginning Compilation...
Failed compilation!
planet9.compiler.error.CompilationException: Compiler not yet implemented
	at planet9.compiler.Compiler.compile(Compiler.java:39)
	at planet9.compiler.app.CompilerApp.main(CompilerApp.java:147)

 

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.

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

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

Announcements



×
×
  • Create New...

Important Information

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