Jump to content

Making a Block that removes itself after 5 seconds


Sirpwnsamin

Recommended Posts

Hello again Modders of Forge!

 

I am trying to make a Block that will remove itself from the world after 5 seconds of being placed. I have tried to use Thread.sleep and wait() in the onBlockPlaced method to no avail. I also tried to use an IScheduledTickHandler. If you have any idea on how to do this please post below. If you need any code snippets I will gladly post if you ask.

Link to comment
Share on other sites

Minecraft is single threaded, wait and thread.sleep are only going to pause the whole game.

 

You need to use the onUpdateTick method of the block and world.scheduleBlockUpdate(...) 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

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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