2

As the title suggests, I am wanting to add custom ores to the game (I.E. new gemstones like ruby, sapphire, topaz, etc), but I have no clue how to control world generation to add such a thing. I tried searching for how to add an ore but all I found was I would need to replace blocks like granite and diorite, which I will accept as the only option but I would prefer not to. I am aiming to edit as few game mechanics as possible, thus meaning I cannot replace any existing vanilla ores or stones because that could reduce abundancy or the resource itself. Ideally, I would like to avoid the usage of any kind of Spigot plugins but I will use them if that means I can do what I am attempting to achieve.

My Minecraft version is 1.18.x

2
  • 3
    you'll need a mod for that, datapack will only allow you to replace existing blocs
    – Esther
    Commented Jun 3, 2022 at 17:18
  • Is there a way to maybe make specific blocks spawn with an entity inside them so I can target them with commands @Esther? Commented Jun 3, 2022 at 17:19

1 Answer 1

1

This is a very complex method, but if you are not using plugins or mods, this is probably one of few ways.

Part 1:

one thing you can try is to have some kind of tagged entity (usually invisible armorstands) get randomly teleported around the world (spreadplayers), and then set their y coordinate to where you want your ores to spawn in the ground. the next part is generating the ore vein or single ore block at where they are (player heads are good for custom blocks but do not take up a full block space).

Part 2:

now that you have the ore blocks set, you need a way to detect if they are broken. you can leave the armor stands and check constantly if the block they are standing at is broken, if so: delete the normally dropped item, spawn your custom item, and kill the armor stand.

This is very difficult to implement, but these instructions should help.

1
  • Thanks much @RIVERMAN2010! All I needed to know is how I could implement the ore generation. I have everything else mostly figured out. Commented Jun 4, 2022 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.