Spawn ore if it can see the sky (to spawn at the top of mountains or at the surface of the end)

Started by Ypermat on

Topic category: Help with modding (Java Edition)

Last seen on 10:28, 30. Oct 2023
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Spawn ore if it can see the sky (to spawn at the top of mountains or at the surface of the end)
Wed, 02/15/2023 - 14:28 (edited)

Hello !

I try to make ores spawn in the end and at the top of mountains.

If I gave the block no additional condition, it do spawn in the end but it is undeground.
I want it to spawn on the surface. I tried something like this :

Block spawn if it sees the sky

But the block do not spawn anymore.

I would appreciate some help, and so, I could make a tutorial for that :)

Edited by Ypermat on Wed, 02/15/2023 - 14:28
Last seen on 00:55, 28. Mar 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The problem you're having is…
Sun, 03/12/2023 - 00:52

The problem you're having is that sky detection counts the block you're calling it from: it's based on position. The position x y z can't see the sky because the ore block is blocking it.

However, if you want an ore to have custom generation, you'd probably be better off making it a structure instead of an ore. (That is, a surface level structure that only spawns in stone, and either generates in groups, or has a custom procedure that spreads more ore upon generation.) Vanilla ore generation is kind of limited for custom ores.