Making an item fall from the sky?

Started by TrueFreesia on

Topic category: Help with Minecraft modding (Java Edition)

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?

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