I am currently in the process of setting up a plugin for a game server i host and i have a whole bunch of items that have a "category" between 1 & 11 as shown in a small snippet below. I only ask this because there are over 200 items i will need to sort into different categories.
"ammo.rifle.hv_0": {
"shortname": "ammo.rifle.hv",
"customIcon": null,
"amount": 64,
"skinId": 0,
"isBp": false,
"category": 9,
"displayName": "HV 5.56 Rifle Ammo",
"cost": 10000,
"cooldown": 0
},
"radiationresisttea.pure_0": {
"shortname": "radiationresisttea.pure",
"customIcon": null,
"amount": 1,
"skinId": 0,
"isBp": false,
"category": 8,
"displayName": "Pure Anti-Rad Tea",
"cost": 10000,
"cooldown": 0
},
"healingtea.pure_0": {
"shortname": "healingtea.pure",
"customIcon": null,
"amount": 1,
"skinId": 0,
"isBp": false,
"category": 8,
"displayName": "Pure Healing Tea",
"cost": 10000,
"cooldown": 0
},
"ammo.rifle_0": {
"shortname": "ammo.rifle",
"customIcon": null,
"amount": 64,
"skinId": 0,
"isBp": false,
"category": 9,
"displayName": "5.56 Rifle Ammo",
"cost": 10000,
"cooldown": 0
},
"blueberries_0": {
"shortname": "blueberries",
"customIcon": null,
"amount": 1,
"skinId": 0,
"isBp": false,
"category": 8,
"displayName": "Blueberries",
"cost": 10000,
"cooldown": 0
}
}
From this is there a way to index them in a way it will select all the ones with a certain "category".
For example, If i want all the ones with "category": 9
it will display the following
"ammo.rifle_0": {
"shortname": "ammo.rifle",
"customIcon": null,
"amount": 64,
"skinId": 0,
"isBp": false,
"category": 9,
"displayName": "5.56 Rifle Ammo",
"cost": 10000,
"cooldown": 0
},
"ammo.rifle.hv_0": {
"shortname": "ammo.rifle.hv",
"customIcon": null,
"amount": 64,
"skinId": 0,
"isBp": false,
"category": 9,
"displayName": "HV 5.56 Rifle Ammo",
"cost": 10000,
"cooldown": 0
}
Please and thank you in advanced