-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cbp
124 lines (112 loc) · 10.9 KB
/
main.cbp
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// summon ArmorStand ~3 ~-2 ~-1 {CustomName:"DisassemblerCCC",Tags:["CCC"],NoGravity:1}
:mainblock PULSE 17 16 1
blockdata ~ ~ ~ {auto:0}
//CREATE CRAFTER
@e[name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Custom Crafter",Items:[{Slot:3b,id:"minecraft:cobblestone",Count:1b,Damage:0s},{Slot:4b,id:"minecraft:tnt",Count:1b,Damage:0s},{Slot:5b,id:"minecraft:cobblestone",Count:1b,Damage:0s},{Slot:6b,id:"minecraft:cobblestone",Count:1b,Damage:0s},{Slot:7b,id:"minecraft:redstone",Count:1b,Damage:0s},{Slot:8b,id:"minecraft:cobblestone",Count:1b,Damage:0s}]}
CONSTART
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] ~ ~ ~ entitydata @e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1,r=0] {ArmorItems:[{},{},{},{id:"minecraft:tnt",Count:1b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] ~ ~ ~ particle lava ~ ~ ~ 0.1 0.1 0.1 5 20 force
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] ~ ~ ~ playsound entity.generic.explode neutral @a[r=5] ~ ~ ~ 1
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] ~ ~ ~ blockdata ~ ~ ~ {Items:[],CustomName:"Disassembler"}
CONEND
//DESTROY CRAFTER
@e[type=ArmorStand,tag=GM4_broken] ~ ~ ~ testfor @e[c=1,r=0,type=ArmorStand] {ArmorItems:[{},{},{},{id:"minecraft:tnt"}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1,tag=GM4_broken] ~ ~ ~ summon Item ~ ~1 ~ {Item:{id:"minecraft:redstone",Count:2b},Passengers:[{id:Item,Item:{id:"minecraft:cobblestone",Count:14}},{id:Item,Item:{id:"minecraft:tnt",Count:1}},{id:Item,Item:{id:"minecraft:crafting_table",Count:1,tag:{display:{Lore:[slightly damaged workbench]}}}}]}
// @e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1,tag=GM4_broken] ~ ~ ~ summon Item ~ ~1 ~ {Item:{id:"minecraft:redstone",Count:2b},Passengers:[{id:Item,Item:{id:"minecraft:cobblestone",Count:14}},{id:Item,Item:{id:"minecraft:tnt",Count:1}},{id:Item,Item:{id:crafting_table,Count:1}}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1,tag=GM4_broken] ~ ~ ~ kill @e[type=ArmorStand,name=GM4_CustomCrafter,c=1]
//CHECK FOR CRAFTERS WITH ITEMS INSIDE
@e[name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler"}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting=0] GM4_crafting = 2
testfor @e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1,GM4_crafting=1,tag=!GM4_isEmpty]
CONDITION
blockdata ~-1 ~ ~ {auto:1b}
blockdata ~ ~ ~ {auto:0b}
// CHECK DISASSEMBLER
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:iron_sword",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 2
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:iron_leggings",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 7
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:golden_leggings",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] gold = 7
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:diamond_leggings",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] dia = 7
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:golden_pickaxe",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] gold = 3
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:diamond_axe",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] dia = 3
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:diamond_sword",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] dia = 2
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:iron_boots",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 4
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:golden_boots",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] gold = 4
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:diamond_boots",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] dia = 4
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:golden_axe",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] gold = 3
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:diamond_hoe",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] dia = 2
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:iron_helmet",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 5
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:golden_helmet",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] gold = 5
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:diamond_helmet",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] dia = 5
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:golden_hoe",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] gold = 2
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:golden_sword",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] gold = 2
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:golden_chestplate",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] gold = 8
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:iron_chestplate",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 8
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:diamond_chestplate",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] dia = 8
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:diamond_shovel",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] dia = 1
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:shears",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 2
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:iron_shovel",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 1
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:iron_pickaxe",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 3
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:iron_axe",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 3
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:iron_hoe",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 2
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:golden_shovel",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] gold = 1
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:diamond_pickaxe",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] dia = 3
@e[type=ArmorStand,name=GM4_CustomCrafter] ~ ~ ~ testforblock ~ ~ ~ dropper -1 {CustomName:"Disassembler",Items:[{id:"minecraft:flint_and_steel",Damage:0s,Count:1b,Slot:4b}]}
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1] iron = 1
// GENERATE RANDOM CHANCES
@e[type=ArmorStand,name=GM4_CustomCrafter] n * 279470273
@e[type=ArmorStand,name=GM4_CustomCrafter] n % 919393
@e[type=ArmorStand,name=GM4_CustomCrafter,n<=0] n + 2147483647
@e[type=ArmorStand,name=GM4_CustomCrafter] count = n
@e[type=ArmorStand,name=GM4_CustomCrafter,iron>0] @e[name=DisassemblerCCC] blockdata ~4 ~3 ~ {auto:1b}
@e[type=ArmorStand,name=GM4_CustomCrafter,gold>0] @e[name=DisassemblerCCC] blockdata ~6 ~4 ~1 {auto:1b}
@e[type=ArmorStand,name=GM4_CustomCrafter,dia>0] @e[name=DisassemblerCCC] blockdata ~5 ~4 ~2 {auto:1b}
//wrong item detection @e[type=ArmorStand,name=GM4_CustomCrafter,iron=0,gold=0,dia=0]
blockdata ~ ~ ~ {auto:0b}
@e[type=ArmorStand,name=GM4_CustomCrafter] count % iron
@e[type=ArmorStand,name=GM4_CustomCrafter] count + 1
@e[type=ArmorStand,name=GM4_CustomCrafter] iron = 0
LOOP 1 8 + 1
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1,count=|0|] blockdata ~ ~ ~ {Items:[{id:"minecraft:iron_ingot",Damage:0s,Count:|0|b,Slot:4b}]}
END
blockdata ~ ~ ~ {auto:0b}
@e[type=ArmorStand,name=GM4_CustomCrafter] count % gold
@e[type=ArmorStand,name=GM4_CustomCrafter] count + 9
@e[type=ArmorStand,name=GM4_CustomCrafter] gold = 0
LOOP 1 8 + 1
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1,count=ADD(|0|;8)] blockdata ~ ~ ~ {Items:[{id:"minecraft:gold_ingot",Damage:0s,Count:|0|b,Slot:4b}]}
END
blockdata ~ ~ ~ {auto:0b}
@e[type=ArmorStand,name=GM4_CustomCrafter] count % dia
@e[type=ArmorStand,name=GM4_CustomCrafter] count + 17
@e[type=ArmorStand,name=GM4_CustomCrafter] dia = 0
LOOP 1 8 + 1
@e[type=ArmorStand,name=GM4_CustomCrafter,GM4_crafting>=1,count=ADD(|0|;16)] blockdata ~ ~ ~ {Items:[{id:"minecraft:diamond",Damage:0s,Count:|0|b,Slot:4b}]}
END