-
-
Notifications
You must be signed in to change notification settings - Fork 14
How to make custom category by JSON format file
It is added timer category by the user, so not build-in categories in SpeedRunIGT.
There are two ways to add custom categories.
in this document explains how to add a custom categories using a JSON format file.
- Windows :
C:\Users\USER_NAME\speedrunigt\categories
- MacOS :
/Users/USER_NAME/speedrunigt/categories
- Linux :
/home/USER_NAME/speedrunigt/categories
it is same as user.home
java system property
Base format :
{
"id": String,
"name": String,
"version": String,
"src_category": String,
"conditions": Condition[][]
}
"conditions"
format :
{
"type": String,
"name": String,
"version: String (Optional),
...
}
-
id
: it is a string for identifying categories. If the IDs match each other, the category will not be added. -
name
: The name of the category that will be displayed in the Timer Categories option. -
version
: The minecraft version string for the category. You can put a specific version or version ranges. here is examples.- any versions :
*
- 1.16.1 only :
1.16.1
- 1.16's all subversions :
1.16.x
- 1.16.x to 1.18.x :
>=1.16- <=1.18-
- 1.16.5 or below :
<=1.16.5
- 1.13 or above :
>=1.13
- any versions :
-
src_category
: The speedrun.com url of category that "More" button of Timer Categories option.- Example :
mcce#Obtain_Item
-> Result URL :https://speedrun.com/mcce#Obtain_Item
- Example :
-
conditions
:-
version
: The version of Minecraft to apply the condition to. This is optional and will be applies to all versions if not present. same format withversion
in category.
-
otherwise is check the below
SpeedRunIGT have 4 types of condition for the custom category.
achieve_advancement
, obtain_item
, player_stat
and dummy
It is trigger when the notified(a.k.a Toast) in your client that it has complete advancement or unlock recipe.
Condition format :
{
"type": "achieve_advancement",
"name": String,
"advancement": String
}
-
name
: The name of the category condition. When the condition is completed, it will be included with this name in the Timeline of the Record file.. -
advancement
: The ID of Advancement or recipe. Example:minecraft:end/the_end
.
In Pre 1.12, it is used as the ID of the Achievement.
It is trigger when the player does have an item in your client.
Condition format :
{
"type": "obtain_item",
"name": String,
"item_id": String, (BUT in Pre 1.8, it is Integer)
"item_amount": Integer, [Optional]
"item_data": Integer or null [Optional]
"item_nbt": String [Optional]
"strict_mode": Boolean [Optional]
}
-
name
: The name of the category condition. When the condition is completed, it will be included with this name in the Timeline of the Record file.. -
item_id
: The ID of the item that the player should have.
But Pre 1.8 does use integers instead of string, so you need to set integers for Pre 1.8. -
item_amount
: [Optional. default:1
] The number of items that the player should have. -
item_data
: [Optional. default:null
] The data(damage) of items that the player should have. -
item_tag
: [Optional. default:(EMPTY STRING)
] The nbt tag of items that the player should have. it must be JSON string. -
strict_mode
: [Optional. default:true
] This means that allobtain_item
in the same condition array must be included in your inventory for the condition to becomplete
.
if you set tofalse
this parameter, If you have obtained the item at least once, the condition will becomplete
even if you don't have that item at the end.
It is trigger when the player's statistics are updated on the server.
Condition format :
{
"type": "player_stat",
"name": String,
"category": String, (BUT in Pre 1.13, not use this parameter)
"stat": String,
"goal": Integer
}
-
name
: The name of the category condition. When the condition is completed, it will be included with this name in the Timeline of the Record file.. -
category
: The type of the statistics. See Resource location in Minecraft Wiki for more information.
But in Pre 1.13, Statistics doesn't have a type, so it is not used. -
stat
: The ID of the stats. See Resource location in Minecraft Wiki for more information. -
goal
: The goal value of the stats that the player should achieve.
It isn't will be normally triggered. it is for other Mods only
Condition format :
{
"type": "player_stat",
"name": String
}
-
name
: The name of the category condition. When the condition is completed, it will be included with this name in the Timeline of the Record file..
Custom Category Conditions supports OR/AND conditioners similar to Minecraft datapacks.\
Not too hard!
In the below case, the conditions is correct if (you have a diamond and killed 10+ slimes) or (complete the end/root
advancement):
...
"conditions": [
// OR block
[
// AND block
{
"type": "obtain_item",
"name": "diamond",
"item_id": "minecraft:diamond"
},
{
"type": "player_stat",
"name": "kill_slime",
"category": "minecraft:killed",
"stat": "minecraft:slime",
"goal": 10
}
],
// OR block
[
// AND block
{
"type": "achieve_advancement",
"name": "enter_end",
"advancement": "minecraft:end/root"
}
]
]
If you have done with this format file, save or insert the file with the .json
extension in the directory I mentioned before.
and then run your client!
Example (Download File)
{
"id": "sample_your_category",
"name": "My Challenge!",
"version": ">=1.13",
"src_category": "mc#idk",
"conditions": [
[
{
"type": "obtain_item",
"name": "diamond",
"item_id": "minecraft:diamond"
},
{
"type": "player_stat",
"name": "kill_slime",
"category": "minecraft:killed",
"stat": "minecraft:slime",
"goal": 10
},
{
"type": "player_stat",
"name": "update_stat",
"category": "minecraft:custom",
"stat": "minecraft:jump",
"goal": 10
}
],
[
{
"type": "achieve_advancement",
"name": "enter_end",
"advancement": "minecraft:end/root"
}
]
]
}