Ores - game-stuff-official/exampledustry GitHub Wiki
Ores are OreBlock
s that drop items when being mined with a drill with the appropriate tier. Ores with higher hardness:
need stronger drills and are drilled slower.
Notice how Harcite is being mined way slower than Explodium. This is because Harcite's hardness is higher than Explodium's.
- Resources
- Mindustry Class Block.java
- Mindustry Class OreBlock.java
File Location and Naming Conventions
Ores go in specific folders in your content folder. They don't necessarily have to go in those folders, but it would cause lag because the Mindustry JSON parser would have to iterate over large parts of your content to find your file. The same is with sprites.
Put ores in content/blocks/environment/ore-[item-name].hjson
Put ore sprites in sprites/blocks/environment/ore-[item-name].png
[!TIP] If you prefer you can further nest your ores into an
/ore
subdirectory.
You will likely have multiple ore sprites. To make use of them you name them in ascending order from 1 like this:
ore-[item-name]1.png
ore-[item-name]2.png
ore-[item-name]3.png
The amount of sprites you will need for your ore is dependent on variants:
in your hjson file.
[!NOTE] The
ore-[item-name]
is a naming convention used in large by the modding community and Anuken himself. You would be wise to do the same. Theitem-name
should be replaced with the item that the ore drops.
Properties
Property Name | Type | Default | What it means |
---|---|---|---|
itemDrop | Item | null | This is the item that the ore will drop when mined. |
Variants | Integer | 3 | This is how many sprites will show in game. If you have 4 sprites for your ore, set this to 4. |
hasColor | Boolean | true | If true, the block's color will be shown on the mini map. |
mapColor | Hex Color | 000000 | Color used in the mini map. |
Note that OreBlock
extends Block
so you can use any property that is owned by Block
.
Code
Ores extend Block
so you can use any property that the Block
class owns but not all properties will work.
Items and Ores work Together.
Each ore has a specified itemDrop:
property in its code. This is the item your ore will drop when mined.
content/blocks/environment/ores/ore-harcite.hjson
name: Harcite
type: OverlayFloor
itemDrop: harcite
variants: 3
hasColor: true
mapColor: 7248a8
wallOre: false
content/items/harcite.hjson
name: Harcite
description: "Rare metal forged in the heart of stars. Surprisingly brittle but powerfully charged."
type: item
color: 7248a8
radioactivity: 1
charge: 5
hardness: 6
cost: 10
Make note that the item controls the hardness of your ore for some reason.