Making an item fall from the sky?

Started by TrueFreesia on

Topic category: Help with modding (Java Edition)

Last seen on 03:19, 18. Aug 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Making an item fall from the sky?

Hey, I'm making a mod based all around stars and angels.

Is there some way to make it so an item randomly spawns throughout the world? Or would I need to do it through loot tables?

Last seen on 11:05, 20. Sep 2024
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
First of all, make a custom…
Wed, 08/09/2023 - 22:13

First of all, make a custom entity with a rare spawn rate. (Make it invisible)

 

Then inside entity spawning procedure you do the following:

Teleport the custom entity into the sky. (maybe y=300)

Then you despawn it.

After despawning it, you spawn a gem item and choose the item you want it to drop from the sky.

 

You must teleport the entity into the sky first before spawning the item, or else it would spawn on the ground