How to make a working random asteroid strike?

Started by SunnyBoyWTF on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a working random asteroid strike?

I have a model I just dont know what to do now whats the next step? How do I go about this?

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
...Depends on how you want…
Sat, 10/14/2023 - 13:58

...Depends on how you want it to work? There's really a lot of ways you could do this. 

You'll probably want to classify your asteroid as some type of projectile, then randomly spawn it very high up somewhere in the vicinity of a player. You could make a procedure with a very small chance of triggering on player-update tick, which picks a random x and z offset for the asteroid. (And, again depending on how you want it to work, should probably have minimum values for the offset so it doesn't spawn directly on top of the player.) You could make a procedure that, on impact with a block, explodes, or generates particles, plays sound effects, etc.

If you want more control over the path/speed of the asteroid, you could make a custom entity instead of a projectile, as there's quite a lot more tools available to tamper with these, though you'd have to make sure to disable AI and whatnot. 

Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want to make it a entity
Sat, 10/14/2023 - 18:07

I want to make it a entity

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, what you can do is "on…
Sat, 10/14/2023 - 18:31

So, what you can do is "on player tick update", have a check that if a random number is between like 1 and 10 000, then it spawns a meteor around the player. How would you do that? simple, you get the player's X and Z coords, and add/remove a random number between, for example, a random number between 200 and -200, and then set the Y coord to about 330, and voilà! you should be done, hope this helps

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
...Just keep in mind that if…
Sat, 10/14/2023 - 19:13

...Just keep in mind that if it's too far, it won't work, you need it to spawn in loaded chunks.