forked from BisUmTo/scarpet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayerheadrecipe.sc
68 lines (64 loc) · 2.33 KB
/
playerheadrecipe.sc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//////
// playerheadrecipe by BisUmTo
// Adds crafting for player_head stating from another skull
//////
__config() -> {
'scope' -> 'global'
};
global_app_name = system_info('app_name');
create_datapack(global_app_name, structure = {
'data' -> {
global_app_name -> {
'tags' -> {'items' -> {
'heads.json' -> {
'values' -> [
'minecraft:skeleton_skull',
'minecraft:wither_skeleton_skull',
'minecraft:player_head',
'minecraft:zombie_head',
'minecraft:creeper_head',
'minecraft:dragon_head'
]
}
}},
'advancements' -> {'recipes' -> {
'repeater.json' -> {
'parent' -> 'minecraft:recipes/root',
'reward' -> {'recipes' -> [
str('%s:player_head', global_app_name)
]},
'criteria' -> {
'has_item' -> {
'trigger' -> 'minecraft:inventory_changed',
'conditions' -> {'items' -> [
{'tag' -> str('%s:heads', global_app_name)}
]}
},
'has_the_recipe' -> {
'trigger' -> 'minecraft:recipe_unlocked',
'conditions' -> {'recipe' -> str('%s:player_head', global_app_name)}
}
},
'requirements' -> [['has_item','has_the_recipe']]
}
}},
'recipes' -> {
'player_head.json' -> {
'type' -> 'minecraft:crafting_shapeless',
'group' -> 'dispenser',
'ingredients' -> [
{'tag' -> str('%s:heads', global_app_name)}
],
'result' -> {
'item' -> 'minecraft:player_head'
}
}
}
}
}
});
write_file('structure', 'json', structure);
run('datapack enable "file/'+global_app_name+'.zip"');
__on_close()-> (
run('datapack disable "file/'+global_app_name+'.zip"')
)