Back to scripts/examples
JS

custom_item_example.js

JavaScript · 47 lines · 910 B

scripts/examples/custom_item_example.js
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
/**
 * Example: Custom Item Creation
 * Demonstrates creating a custom item via JavaScript
 */

console.log("Creating custom items...");

// Create a fire sword
API.registerItem(
    "fire_sword",
    "DIAMOND_SWORD",
    "&c&lFire Sword",
    "&7Sets enemies on fire",
    "&7Damage: &c+10",
    "",
    "&6Epic Item"
);

console.log("Fire Sword registered!");

// Create a healing staff
API.registerItem(
    "healing_staff",
    "STICK",
    "&a&lHealing Staff",
    "&7Right-click to heal nearby players",
    "&7Cooldown: &e5 seconds",
    "",
    "&5Rare Item"
);

console.log("Healing Staff registered!");

// Create a speed boots
API.registerItem(
    "speed_boots",
    "LEATHER_BOOTS",
    "&b&lSpeed Boots",
    "&7Grants permanent speed boost",
    "&7Speed: &e+50%",
    "",
    "&6Legendary Item"
);

console.log("Speed Boots registered!");
console.log("All custom items created successfully!");