Date: 2020/01/20 05:55:35 UTC-08:00
Type: Denizen Script
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
getProceduralItem:
type: task
definitions: level
speed: 1t
debug: true
script:
- if !<[level].exists>:
- narrate "<red>Level not speficied. Proceeding with level 50."
- define level 50
- flag server proceduralItemLevel:<[level]>
- give i@proceduralWeapon
- flag server proceduralItemLevel:!
proceduralWeapon:
type: item
material: <proc[proceduralMaterial]>
display name: <proc[randomName]>
lore:
- <proc[randomLore]>
mechanisms:
enchantments: <proc[randomEnchantments]>
nbt_attributes:
- generic.armor/head/2/3
proceduralMaterial:
type: procedure
script:
- if !<server.has_flag[proceduralItemLevel]>:
- narrate "<red>Server is missing the flag proceduralItemLevel."
- determine wooden_sword
- define returnValue wooden_sword
- define level <server.flag[proceduralItemLevel]>
- narrate <[swords].get[3]>
- if <[level]> >= 50:
- define returnValue diamond_sword
- else:
- random:
- define returnValue wooden_sword
- define returnValue stone_sword
- define returnValue iron_sword
- define returnValue gold_sword
- define returnValue diamond_sword
- determine "<[returnValue]><proc[proceduralMaterialNbtAttributes]>"
proceduralMaterialNbtAttributes:
type: procedure
definitions: level
script:
- determine "[nbt_attributes=<list[generic.maxHealth/mainhand/0/2|generic.attackDamage/mainhand/0/5|generic.attackSpeed/mainhand/0/-3|generic.movementSpeed/mainhand/0/0.05|generic.knockbackResistance/mainhand/0/0.1]>]"
randomName:
type: procedure
script:
- random:
- determine "Name 1"
- determine "Name 2"
randomLore:
type: procedure
script:
- random:
- determine "Lore 1"
- determine "Lore 2"
randomEnchantments:
type: procedure
script:
- determine <list[DAMAGE_ALL,<util.random.int[1].to[10]>|KNOCKBACK,3]>