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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
// change weird item names to be more consistent with modern vanilla
const ITEMS = {
'log': 'oak_log',
'log:1': 'spruce_log',
'log:2': 'birch_log',
'log:3': 'jungle_log',
'log_2': 'acacia_log',
'log_2:1': 'dark_oak_log',
'sand:1': 'red_sand',
'ink_sack': 'ink_sac',
'ink_sack:3': 'cocoa_beans',
'ink_sack:4': 'lapis_lazuli',
'raw_fish': 'cod',
'raw_fish:1': 'salmon',
'raw_fish:2': 'tropical_fish',
'raw_fish:3': 'pufferfish',
'raw_salmon': 'salmon',
'cooked_fish': 'cooked_cod',
'magma_fish': 'magmafish',
'seeds': 'wheat_seeds',
'sulphur': 'gunpowder',
'raw_chicken': 'chicken',
'pork': 'porkchop',
'potato_item': 'potato',
'carrot_item': 'carrot',
'mushroom_collection': 'red_mushroom',
'nether_stalk': 'nether_wart',
'water_lily': 'lily_pad',
'melon': 'melon_slice',
'ender_stone': 'end_stone',
'gemstone_collection': 'gemstone',
'mycel': 'mycelium',
'cocoa': 'cocoa_beans',
'redstone_lamp_off': 'redstone_lamp',
'redstone_comparator': 'comparator',
'redstone_torch_on': 'redstone_torch',
'iron_plate': 'light_weighted_pressure_plate',
'gold_plate': 'heavy_weighted_pressure_plate',
'huge_mushroom_1': 'red_mushroom_block',
'huge_mushroom_2': 'brown_mushroom_block',
'iron_ingot': 'iron_ingot',
'iron': 'iron_ingot',
'gold': 'gold_ingot',
'hard_clay': 'stained_hardened_clay',
'stained_clay': 'stained_hardened_clay',
'wood_sword': 'wooden_sword',
'wood_spade': 'wooden_shovel',
'wood_pickaxe': 'wooden_pickaxe',
'wood_axe': 'wooden_axe',
'wood_hoe': 'wooden_hoe',
'stone_spade': 'stone_shovel',
'gold_sword': 'golden_sword',
'gold_spade': 'golden_shovel',
'gold_pickaxe': 'golden_pickaxe',
'gold_axe': 'golden_axe',
'gold_hoe': 'golden_hoe',
'gold_helmet': 'golden_helmet',
'gold_chestplate': 'golden_chestplate',
'gold_leggings': 'golden_leggings',
'gold_boots': 'golden_boots',
'gold_barding': 'golden_horse_armor',
'iron_barding': 'iron_horse_armor',
'iron_spade': 'iron_shovel',
'diamond_spade': 'diamond_shovel',
'gold_record': 'record_13',
'green_record': 'record_cat',
'record_3': 'record_blocks',
'record_4': 'record_chirp',
'record_5': 'record_far',
'record_6': 'record_mall',
'record_7': 'record_mellohi',
'record_8': 'record_stal',
'record_9': 'record_strad',
'record_10': 'record_ward',
'record_12': 'record_wait',
'sulphur_ore': 'sulphur',
'step': 'stone_slab',
'nether_fence': 'nether_brick_fence',
'empty_map': 'map',
'nether_brick_item': 'nether_brick',
'book_and_quill': 'writable_book',
'mushroom_soup': 'mushroom_stew',
'red_rose': 'red_flower',
'firework': 'fireworks',
'skull_item': 'skull',
'endstone': 'end_stone',
'lapis_lazuli_block': 'lapis_block',
'snow_ball': 'snowball',
'raw_beef': 'beef',
'eye_of_ender': 'ender_eye',
'grilled_pork': 'cooked_porkchop',
'glistering_melon': 'glistering_melon_slice',
'cactus_green': 'green_dye',
'enchanted_lapis_lazuli': 'enchanted_lapis_lazuli',
'enchanted_potato': 'enchanted_potato',
'enchanted_birch_log': 'enchanted_birch_log',
'enchanted_gunpowder': 'enchanted_gunpowder',
'enchanted_raw_salmon': 'enchanted_salmon',
'enchanted_raw_chicken': 'enchanted_chicken',
'enchanted_water_lily': 'enchanted_lily_pad',
'enchanted_ink_sack': 'enchanted_ink_sac',
'enchanted_melon': 'enchanted_melon_slice',
'enchanted_glistering_melon': 'enchanted_glistering_melon_slice'
} as const
/** Weirdly named items by Hypixel */
export type hypixelItemNames = keyof typeof ITEMS
/** Cleaner names by us */
export type cleanItemNames = (typeof ITEMS)[keyof typeof ITEMS]
/** Clean an item with a weird name (log_2:1) and make it have a better name (dark_oak_log) */
export function cleanItemId(itemId: string): string {
itemId = itemId.toLowerCase()
if (itemId in ITEMS)
return ITEMS[itemId]
if (itemId.includes(':')) {
const [item, damage] = itemId.split(':')
if (item in ITEMS)
return ITEMS[item] + ':' + damage
}
return itemId
}
|