So for this metal detector item I'm making I need a key-value pair structure officially supported by Mojang in a json file. I have been recommended tags but those simply just don't fit for my needs. The problem I'm having is that the official tags are very limited, see below.
I want the player to be able to choose which type of ore they want to detect rather than to just detect all ores and point to the closest ore. You could also implement a "valuabilityscore" system or something like that but tags still wouldn't work for that.
Here's the structure I have to work with:
{
"replace": false,
"values": [
{
"id": "minecraft:iron_ore",
"findingDistanceMultiplier": 1,
"values": [
"#minecraft:iron_ores"
]
},
{
"id": "minecraft:gold_ore",
"findingDistanceMultiplier": 0.5,
"values": [
"#minecraft:gold_ores"
]
},
{
"id": "minecraft:copper_ore",
"findingDistanceMultiplier": 1.5,
"values": [
"#minecraft:copper_ores"
]
},
{
"id": "minecraft:ancient_debris",
"findingDistanceMultiplier": 0.2,
"values": [
"minecraft:ancient_debris"
]
}
]
}
I don't know if it's a good idea to every time loop through these to find the value field. It just feels hacky and it's frustrating to implement.
Here's the structure I want to work with:
{
"replace": false,
"values": [
"minecraft:iron_ore": {
"findingDistanceMultiplier": 1,
"values": [
"#minecraft:iron_ores"
]
},
"minecraft:gold_ore": {
"findingDistanceMultiplier": 0.5,
"values": [
"#minecraft:gold_ores"
]
},
"minecraft:copper_ore": {
"findingDistanceMultiplier": 1.5,
"values": [
"#minecraft:copper_ores"
]
},
"minecraft:ancient_debris": {
"findingDistanceMultiplier": 0.2,
"values": [
"minecraft:ancient_debris"
]
}
]
}
Is it possible to implement the latter in one way or the other in vanilla Minecraft? If so, how would I even use it? It would be nice to have that mod compatibility. But I could also use the former data structure if I can figure out how to loop through the Json file and find the value field i'm looking for. If you have answers to any of these question please do respond