-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathitemstack-wrapper.txt
More file actions
31 lines (25 loc) · 886 Bytes
/
itemstack-wrapper.txt
File metadata and controls
31 lines (25 loc) · 886 Bytes
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
Storage = ItemStacks
Representation = Wrapping ItemStack System
Syntax {
val apple = Item(ItemType.Apple) = Would create an item that represents one apple.
apple.editNBT {}
apple.displayName = colored("&cApple")
apple.lore = coloredListOf("&fI'm a big ole red apple.")
val dirt = Item(BlockType.Dirt, variation = BlockType.Dirt.Coarse) {
displayName = colored("&b&lFancy Dirt")
lore = coloredListOf("&fI'm the fanciest dirt in town.")
editNBT {
int("hello", 5)
}
}
val redWool = Item(BlockType.Wool, variation = BlockColor.Red) {
displayName = "Tom1024"
lore = listOf("lol")
}
val diamondSword = Item(ItemType.Sword, variation = ToolMaterial.Diamond) {
durability = .5 // Sets the durability to 50%.
enchant(Enchantment.SHARPNESS, 45)
safeEnchant(Enchantment.UNBREAKING, 4555) // Would error. Definitely.
itemFlag(ItemFlag.HIDE_ENCHANTS)
}
}