- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Procedural Monster Spawning


By Xericore
Created: 2015/11/08 14:30:23 UTC-08:00 (9 years and 46 days ago)
Edited: 2015/11/08 14:30:23 UTC-08:00 (9 years and 46 days ago)
Likes: 0

Staff pick as of: 2015/11/08 14:34:50 UTC-08:00 (9 years and 46 days ago)
Denizen Version: 0.9.7
Script Version: 1.0
Description:

Spawn procedurally generated mobs! Each encounter will be different from the one before.
When a player enters an area, procedural mobs will spawn.
Easily set the difficulty by changing a single value. More challenging than normal mobs.
Mobs drop custom loot with lore (Weapons tuned for a fair SMP experience. No overpowered items dropped.)
Procedurally spawed mobs drop more XP when killed.


Download script | View raw 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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
150100

# Copyright (c) 2015, Xericore 

# Redistribution and use in source and binary forms, with or without 
# modification, are permitted provided that the following conditions are met: 
#    * Redistributions of source code must retain the above copyright notice. 

#¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸#
#                                                                                                                             #
#                                     PROCEDURAL        MONSTER         SPAWNING                                              #         
#                                                                                                                             #
#¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸.·´¯`·.¸#
#
# FEATURES:
#   
#   - Spawn procedurally generated mobs! Each encounter will be different from the one before.
#   - When a player enters an area, procedural mobs will spawn.
#   - Easily set the difficulty by changing a single value. More challenging than normal mobs.
#   - Mobs drop custom loot with lore (Weapons tuned for a fair SMP experience. No overpowered items dropped.)
#   - Procedurally spawed mobs drop more XP when killed.
#
# INSTALLATION:
#
#   0. Make sure you have the plugins Citizens 2 and Denizen installed.
#
#   1. Copy this file to plugins\Citizens\plugins\Denizen\scripts
#
#   2. execute "/gamerule sendCommandFeedback false" 
#       manually in each world you wish you use this script in to suppress 
#       the summon commands output ("Object successfully summoned").
#
# SETTING UP YOUR FIRST SPAWNING AREA:
#
#   0. Check out http://www.petricevic.net/minecraft/procedural-monsters/ for a tutorial containing images.
#
#   1. Obtain cuboid coordinates. 
#      Optional, but recommended is to use WorldEdit + WorldEditCUI, select cuboid and then execute //size. 
#      Note the coordinates of the corners of the cube.
#
#   2. Add cuboid to Denizen notable list, with e.g. coordinates:
#      /ex note cu@2500,64,500,world|2510,64,510,world as:myCuboid
#      Don't forget to change 'world' to your world name.
#
#   3. Add to script below named 'spawnProceduralMobs_world_events' (or to your own world script):
#      on player enters myCuboid:
#      - run spawnProceduralMobs def:myCuboid
#
#   4. Enter the cuboid at the specified coordinates and start fighting!
#
#   Recommended: Check out the plugin TreasureChest to let your monsters guard a treasure!
#                https://www.spigotmc.org/resources/treasurechest-reloaded.1747/
#
#
# ADJUSTING DIFFICULTY, MOB COUNT AND MORE:
#
#   1. Instead of '- run spawnProceduralMobs def:myCuboid', you can specify additional parameters, e.g.:
#
#      - run spawnProceduralMobs def:myCuboid|50|6
#                                    ^        ^  ^
#                        spawnCuboid|difficulty|monsterCount
#
#   spawnCuboid:  Defines the cuboid in which the mobs will spawn. Note that you can have a different cuboid for triggering the spawn
#                 and for spawning the actual monsters. To do this, create a new cuboid e.g. 'myTriggerCuboid' and change the event to:
#                 on player enters myTriggerCuboid: - run spawnProceduralMobs def:myCuboid
#                 Many more events are possible to trigger the spawning, e.g. lever pulls etc. Check the denizen events for more information.
#                 A random location suitable for mob spawning within this cuboid will be automatically selected for spawning.
#                 You may enter it with or without the object notation (the cu@ in front) .
#                 e.g. cu@myCuboid or myCuboid. 
#                 Execute "/denizen save" and check notables.yml to see if the cuboid is present if you experience any issues.
#
#   difficulty:   How strong the spawned enemies will be. Should be between 1-maxDifficulty (default: 100). 
#                 Note that this specifies the bosses level/difficulty. Minions will spawn with half the level of the boss.
#                 This can be changed by altering the mobToBossDifficulty constant in the pmsGlobal task script.
#                 Difficulty 50 can be already quite tough for players without enchanted gear.
#                 Default: 30
#
#   monsterCount: The amount of enemies to spawn. Should be >=1. If set to 0, no mobs will spawn. The boss will always spawn first. 
#                 You can enter <util.random.int[3].to[6]> to randomize the count. 
#                 Default: 5
#
#   ignorecooldown: When true, mobs will always spawn when a player enters the cuboid.
#                 When false, mobs will not spawn for 'treasure_SP_cooldown' (default: 30 minutes) after a player enters the cuboid.
#                 You should only set this to true for testing purposes, 
#                 otherwise you will get spammed with monsters every time you enter the cuboid.
#                 Default: false
#

# @version:       1.0 (8.11.2015)
# @author:        Xericore
# @email:         xericore@gmail.com
# @website:       http://www.petricevic.net/minecraft/procedural-monsters/
#
# Tested with Denizen 0.9.7 (build 1601) and Citizens 2.0.16 (build 1272)
#


# >>>>>>>>>>>>>>>>>>>>>>>>    ADD YOUR SPAWN CUBOIDS IN THIS SCRIPT   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
spawnProceduralMobs_world_events:
  type: world
  events:
  
#    HERE ARE SOME EXAMPLES:
#    on player enters myCuboid:
#    - run spawnProceduralMobs def:myCuboid
    
#    on player enters treasure_1_trigger:
#    - run spawnProceduralMobs def:treasure_1_spawn|60|<util.random.int[4].to[8]>
  
#    on player walks over treasure_2_step:
#    - run spawnProceduralMobs def:treasure_2_spawn|50|<util.random.int[1].to[10]>|true
    
    
# You may adjust the values below to your liking. 
# But be careful, as they have been carefully fine-tuned for a good SMP experience. 
pmsGlobal: 
  type: task 
  default constants:
    # Monsters will not spawn this long for that player finding a treasure
    treasure_SP_cooldown: 30m
    # Player 1 enters the trigger cuboid. Player 2 now has this much time to enter it as well before monsters spawn for player 2.
    treasure_MP_cooldown: 10m
    
    # Normal mobs will have 0.5 * boss difficulty
    mobToBossDifficulty: 0.5

    # Probability of a boss being spawned with a player head mapped to level 0 - maxDifficulty (default: 100).
    # All players who have ever visited the server will be part of the pool containing spawnable heads.
    # Default values mean: Boss with level 0 will have 0% of having player head, and boss with level 100 will have 40%.
    playerHeadProbability: 0|0.4

    # The probability for the mobs to drop a single item.
    # Be careful when you change this value, as it has been carefully fine tuned. Increasing these values might
    # lead to significantly more items being dropped.
    dropRate: 0.20|0.08

    babyPercentage: 0.3|-1

    # Mobs with min level will have 10% (=0.1) chance of having an item equipped.
    # Mobs with max level will have 100% (=1) chance of having an item equipped.
    equipRange: 0.3|1
    
    # In percent. E.g.: 0 = Five players have same difficulty as one player.
    # 15 = Difficulty is 130% for three players (adding 15% difficulty per additional player)
    # One player will always have difficulty 100% scaled to maxDifficulty
    difficultyIncreasePerPlayer: 25
    
    maxDifficulty: 100
    
    # How many XP an enemy will drop.
    xpRange: 0|100
    
    mobHP: 10|200
    mobSpeed: 0.25|0.4
    attackDamage: 1.5|7
    knockbackResistance: -0.5|1
    
    weapons: sword_1|sword_2|sword_3|sword_4|sword_5|sword_6|sword_7|sword_8|sword_9|sword_10|sword_11|sword_12|sword_13|sword_14|sword_15|sword_16
    bows: bow_1|bow_2|bow_3|bow_4|bow_5|bow_6
    helmets: helmet_1|helmet_2|helmet_3|helmet_4|helmet_5|helmet_6|helmet_7|helmet_8|helmet_9|helmet_10|helmet_11|helmet_12|helmet_13|helmet_14|helmet_15|helmet_16|helmet_17
    chestplates: chestplate_1|chestplate_2|chestplate_3|chestplate_4|chestplate_5|chestplate_6|chestplate_7|chestplate_8|chestplate_9|chestplate_10|chestplate_11|chestplate_12|chestplate_13|chestplate_14|chestplate_15
    leggings: leggings_1|leggings_2|leggings_3|leggings_4|leggings_5|leggings_6|leggings_7|leggings_8|leggings_9|leggings_10|leggings_11|leggings_12
    boots: boots_1|boots_2|boots_3|boots_4|boots_5|boots_6|boots_7|boots_8|boots_9|boots_10|boots_11|boots_12
    
    # Doesn't work correctly right now because Minecraft ties the durability of an item
    # to the DropChance. If DropChance is between 0 and 1, it will automatically generate
    # a random durability for the dropped item, regardless of the actual setting.
    # If however the DropChance is > 1, the durability will be the set number, but then the item will always drop.
    # I'm leaving this in as it might chance in the future (now is: Minecraft 1.8.8, 07.11.2015)
    itemDamaged: 0.2|0.9

    
#######################################################################################################################
######################## BE CAREFUL, CHANGING CODE BELOW THIS LINE MIGHT BREAK THE SCRIPT #############################
#######################################################################################################################
xRandomTreasureMessage:
    type: procedure
    script:
    - random {
      - define value "You are not alone..."
      - define value "Something seems wrong in here..."
      - define value "You hear the floor cracking..."
      - define value "Looks like there's someone else here..."
      - define value "You feel a cold shiver running down your spine..." 
      - define value "This place seems strange..." 
      - define value "You feel an evil presence around you..."
      - define value "Things are not the way they seem here..." 
      - define value "This looks like a trap..."
      - define value "This place is not as peaceful as it looks..."
      - define value "You suddenly regret coming here..." 
    }
    - determine %value%


treasureMobs_XP:
  type: world
  events:
    on entity killed:
    - if <context.entity.name> != null {
      # e.g. Rulemoot the Destroyer (Lv 64)
      - if <context.entity.name.matches[^.*\(\w+.(\d+).*]> {
        # Extract number 64 from "Rulemoot the Destroyer (Lv 64)"
        - define level <context.entity.name.regex[^.*\(\w+.(\d+).*].group[1]>
        - if %level% < 0 {
          - define level 0
        }
        else if %level% > <s@pmsGlobal.constant[maxDifficulty]> {
          - define level <s@pmsGlobal.constant[maxDifficulty]>
        }
        - define xpDrop <proc[lerp].context[xpRange|%level%|true]>
        - drop xp qty:<def[xpDrop].as_int> <context.entity.location>
      }
    }

spawnProceduralMobs:
  type: task
  definitions: spawnCuboid|difficulty|monsterCount|ignorecooldown
  script:
  - ^if <def[spawnCuboid].contains[cu@]> == false {
    # User forgot to enter cu@ for spawnCuboid, add it in front of the string and try to continue...
    - ^define spawnCuboid cu@%spawnCuboid%
  }
  - ^if !<def[ignorecooldown].exists> {
    - define ignorecooldown false
  }
  
  - ^define treasurename <def[spawnCuboid].notable_name>
  
  - ^define cooldownOK false
  - ^if !<player.has_flag[%treasurename%_found]> && !<global.has_flag[%treasurename%_MP_cooldown]> {
    - ^define cooldownOK true
  }
  
  - ^if %ignorecooldown% || %cooldownOK% {
    # narrate to all players within range
    - ^narrate <proc[xRandomTreasureMessage]> targets:<player.location.find.players.within[36]>

    - ^if !<def[difficulty].exists> {
      - ^define difficulty 30
    }
    
    - ^if !<def[monsterCount].exists> {
      - ^define monsterCount 5
    }
    
    # Randomize spawn locations so that mobs don't always spawn at the same spot.
    - ^define locationList <def[spawnCuboid].get_spawnable_blocks.random[%monsterCount%]>
    
    - ^foreach <def[locationList]> {
      - ^if <def[value].world.is[!=].to[null]> {
        - flag player %treasurename%_found duration:<s@pmsGlobal.constant[treasure_SP_cooldown]>
        - flag global %treasurename%_MP_cooldown duration:<s@pmsGlobal.constant[treasure_MP_cooldown]>

        - ^define handEquip <proc[randomitem].context[weapons|%difficulty%|true]>
        # One boss will be spawned
        - ^if %loop_index% == 1 {
          - ^define drop <proc[lerp].context[dropRate|<def[difficulty]>|true]>
          - ^define dropChances "<def[drop]>F,<def[drop]>F,<def[drop]>F,<def[drop]>F,<def[drop]>F"

          - ^define theMob <proc[getProceduralMob].context[%difficulty%|true]>
          - ^if <def[theMob].entity_type.is[==].to[SKELETON]> {
            # Skeletons will have bows most of the time (75%) and swords sometimes (25%)
            - ^define handEquip <proc[randomitem].context[<li@weapons|bows.get[<util.random.int[<util.random.int[1].to[2]>].to[2]>]>|%difficulty%|true]>
          }
          # as_op is necessary so that the summon command works in every world the player is in
          # If the command was executed as_server, it would only work in the main world and not in e.g. the nether
          - ^run spawnSummonWrapper def:as_op|%value%|<def[theMob]>|hand:<def[handEquip]>/head:<proc[randomitem].context[helmets|%difficulty%|true]>/chest:<proc[randomitem].context[chestplates|%difficulty%|true]>/legs:<proc[randomitem].context[leggings|%difficulty%|true]>/boots:<proc[randomitem].context[boots|%difficulty%|true]>/DropChances:[%dropChances%]|%difficulty%|true instantly
        }
        else {
          # At this point, the boss has already been spawned.
          # The rest of the locations will be filled with random mobs with half the boss level
          - ^define drop <proc[lerp].context[dropRate|<def[difficulty]>|false]>
          - ^define dropChances "<def[drop]>F,<def[drop]>F,<def[drop]>F,<def[drop]>F,<def[drop]>F"
          - ^define theMob <proc[getProceduralMob].context[%difficulty%|false]>
          - ^if <def[theMob].entity_type.is[==].to[SKELETON]> {
            - ^define handEquip <proc[randomitem].context[<li@weapons|bows.get[<util.random.int[<util.random.int[1].to[2]>].to[2]>]>|%difficulty%|false]>
          }
          - ^run spawnSummonWrapper def:as_op|%value%|<def[theMob]>|hand:<def[handEquip]>/head:<proc[randomitem].context[helmets|%difficulty%|false]>/chest:<proc[randomitem].context[chestplates|%difficulty%|false]>/legs:<proc[randomitem].context[leggings|%difficulty%|false]>/boots:<proc[randomitem].context[boots|%difficulty%|true]>/DropChances:[%dropChances%]|%difficulty%|false instantly
        }
      }
    }
  }

  
myrandomBossName:
    type: procedure
    definitions: difficulty
    script:
    - random {
      - define value "<red>Benttree"
      - define value "<red>Boltfire The Swift"
      - define value "<red>Boltlock"
      - define value "<red>Clayshock The Hunter"
      - define value "<red>Crashshadow"
      - define value "<red>Dirtsneak"
      - define value "<red>Flamegut The Crazed"
      - define value "<red>Killmurk"
      - define value "<red>Plantcinder The Regulator"
      - define value "<red>Shadowlurk"
      - define value "<red>Skullbash"
      - define value "<red>Skullbeast The Skeletal"
      - define value "<red>Slytear The Smart"
      - define value "<red>Smashchain The Gibbering"
      - define value "<red>Spiritstorm The Magician"
      - define value "<red>Steelflame The Binder"
      - define value "<red>Tomblock The Runner"
      - define value "<red>Wirespirit The Sneaky"
      - define value "<red>Evilfire"
      - define value "<red>Hellcraft"
      - define value "<red>Metalhunt"
      - define value "<red>Nailtrap The Desirable"
      - define value "<red>Rotgreed The Terrifying"
      - define value "<red>Rulemaw"
      - define value "<red>Ruleroot"
      - define value "<red>Shadescare"
      - define value "<red>Terrorstorm The Charnel"
      - define value "<red>Treevault"
      - define value "<red>Deadmace"
      - define value "<red>Coffincharge The Decayed"
      - define value "<red>Freezehaunt The Crusher"
      - define value "<red>Ghoullurk"
      - define value "<red>Rapidbolt The Ever-hungry"
      - define value "<red>Scarepassion The Striker"
      - define value "<red>Tombseek The Black"
    }
    - if <def[difficulty].exists> {
      - define value "<def[value]> (Lv <def[difficulty]>)"
    }
    - determine %value%

getProceduralMob:
  type: procedure
  definitions: difficulty|isBoss
  script:
  - define hp <proc[randomMobHP].context[<def[difficulty]>|<def[isBoss]>]>
  - define speed <proc[lerp].context[mobSpeed|<def[difficulty]>|<def[isBoss]>]>
  - define attackDamage <proc[lerp].context[attackDamage|<def[difficulty]>|<def[isBoss]>]>
  - define knockbackResistance <proc[lerp].context[knockbackResistance|<def[difficulty]>|<def[isBoss]>]>

  # Take a random player who has ever played on the server and set his face to the boss
  - if <def[isBoss]> && <util.random.decimal.is[OR_LESS].than[<proc[lerp].context[playerHeadProbability|<def[difficulty]>|<def[isBoss]>]>]> {
    - define skull ";skull=<server.list_players.random.name>"
  }
  - if <util.random.decimal.is[OR_LESS].than[<proc[lerp].context[babyPercentage|<def[difficulty]>|<def[isBoss]>]>]> {
    - define isBaby ";age=baby"
  }
  # TODO knockbackresistence as parameter
  - define defaultAttributes max_health=<def[hp]><tern[<def[skull].exists>]:<def[skull]>||>;health=<def[hp]>;movementSpeed=<def[speed]>;attackDamage=<def[attackDamage]>;followRange=64;knockbackResistance=<def[knockbackResistance]>

  - if <def[isBoss].exists> && <def[isBoss].is[==].to[true]> {
    - define bossAttributes custom_name=<proc[myrandomBossName].context[<def[difficulty]>]>;%defaultAttributes%
    - random {
      # TODO ;villager=true
      #- determine e@ghast[custom_name=<proc[myrandomBossName]>;<def[defaultAttributes]>]
      - determine e@skeleton[%bossAttributes%;skeleton=WITHER]
      - determine e@pig_zombie[%bossAttributes%]
      - determine e@zombie[%bossAttributes%]
    }
  }
  else {
    - define defaultAttributes "custom_name=<gray>Lv <def[difficulty].mul[<s@pmsGlobal.constant[mobToBossDifficulty]>].round>;%defaultAttributes%"
    - random {
      - determine e@witch[<def[defaultAttributes]>]
      - determine e@creeper[<def[defaultAttributes]>]
      - determine e@creeper[powered=true;<def[defaultAttributes]>]
      # TODO ;jockey=true
      #- determine e@endermite[<def[defaultAttributes]>]
      #- determine e@silverfish[<def[defaultAttributes]>]
      - determine e@blaze[<def[defaultAttributes]>]
      - determine e@zombie[<def[defaultAttributes]><tern[<def[isBaby].exists>]:<def[isBaby]>||>]
      - determine e@pig_zombie[<def[defaultAttributes]><tern[<def[isBaby].exists>]:<def[isBaby]>||>]
      - determine e@skeleton[<def[defaultAttributes]>]
      #- determine e@rabbit[color=KILLER;<def[defaultAttributes]>]
    }
  }

randomMobHP:
    type: procedure
    definitions: difficulty|isBoss
    script:
    - define mobHP <proc[lerp].context[mobHP|<def[difficulty]>|<def[isBoss]>]>
    - determine <proc[gaussRand].context[<def[mobHP]>|1|<s@pmsGlobal.constant[mobHP].as_list.get[2]>].round>

gaussRand:
  type: procedure
  # TODO implement sigma as percentage
  definitions: myinput|min|max
  script:
  - define returnValue <math:<util.random.gauss>*(%myinput%/16)+%myinput%>
  - if <def[min].exists> && <def[max].exists> {
    - if <el@val[%returnValue%].is[LESS].than[<el@val[%min%]>]> {
      - define returnValue %min%
    }
    else if <el@val[%returnValue%].is[MORE].than[<el@val[%max%]>]> {
      - define returnValue %max%
    }
  }
  - determine %returnValue%

randomitem:
    type: procedure
    definitions: globalconstname|difficulty|isBoss
    script:
    - define itemlist <s@pmsGlobal.constant[%globalconstname%].as_list>
    - if !<def[isBoss].exists> || <def[isBoss].is[==].to[false]> {
      # Normal mob's item level will be 1/2 of the boss item level
      - define difficulty <def[difficulty].mul[<s@pmsGlobal.constant[mobToBossDifficulty]>].round>
    }

    - define itemlevel <proc[lerpIndex].context[%globalconstname%|%difficulty%]>
    # weigh generated item levels closer to max level. E.g: difficulty 50/100 -> most itemlevels will be in range 30-50
    # E.g. Boss with level 50 will get item 5 (if 10 items in list).
    - define myrand <util.random.int[<util.random.int[0].to[<def[itemlevel]>]>].to[<def[itemlevel]>]>
    - determine <def[itemlist].get[%myrand%]>

# Linear interpolation
lerp:
  type: procedure
  # passing the list directly always only passed the first item from the list, thus globalconstname
  definitions: globalconstname|difficulty|isBoss
  script:
    - if !<def[difficulty].exists> {
      - announce to_console "PMS: Difficulty not specified, assuming 50%."
      - define difficulty <s@pmsGlobal.constant[maxDifficulty].div[2]>
    }

    - if !<def[isBoss].exists> || <def[isBoss].is[==].to[false]> {
      - define difficulty <def[difficulty].mul[<s@pmsGlobal.constant[mobToBossDifficulty]>].round>
    }

    - define valuelist <s@pmsGlobal.constant[%globalconstname%].as_list>

    - if <def[valuelist].exists> && <el@val[<def[valuelist].size>].is[MORE].than[1]> {

      # 0.6 - 0.2 = 0.4
      - define rangeDelta <math:<def[valuelist].get[2]>-<def[valuelist].get[1]>>
      # 60/100 * 0.4 = 0,24 -> 0,24+0,2 = 0,44 -> calculated 60% from 0.2...0.6
      - define returnlevel <math:(%difficulty%/<s@pmsGlobal.constant[maxDifficulty]>)*%rangeDelta%+<def[valuelist].get[1]>>
    }
    else {
      # Couldn't find range from provided list, trying to return first item in list. Will be null if list is empty.
      - define returnLevel <def[valuelist].get[1]>
    }
    - determine <def[returnlevel]>

lerpIndex:
  type: procedure
  definitions: globalconstname|difficulty
  script:
    - if !<def[difficulty].exists> {
      - narrate "Difficulty not specified, assuming 50%"
      - define difficulty <s@pmsGlobal.constant[maxDifficulty].div[2]>
    }
    # map difficulty to number of items in list. Must be integer to access list via .get[i] later, thus .round at the end
    - define itemlevel <def[difficulty].div[<s@pmsGlobal.constant[maxDifficulty]>].mul[<s@pmsGlobal.constant[%globalconstname%].as_list.size>].round>
    - determine <def[itemlevel]>

# each player adds difficultyIncreasePerPlayer (percent) difficulty
playerCountDifficulty:
  type: procedure
  definitions: difficulty
  script:
  - define playerCount <player.location.find.players.within[36].size>
  # (( 15 * 3 - 15 )/100) * <s@pmsGlobal.constant[maxDifficulty]>
  - if <def[playerCount].is[MORE].than[1]> {
    - define temp <math:((<s@pmsGlobal.constant[difficultyIncreasePerPlayer]>*%playerCount%-<s@pmsGlobal.constant[difficultyIncreasePerPlayer]>)/100+1)*<def[difficulty]>>
    - determine <def[temp].round>
  }
  else {
    - determine <def[difficulty]>
  }


########################################################################################################################################
# spawnSummonWrapper
########################################################################################################################################
spawnSummonWrapper:
  type: task
  definitions: as_executor|location|entity|equip|difficulty|isBoss
  script:
  - define entityAttributes <def[entity].split[regex:\w@\w+\[]>
  - define entityAttributes <def[entityAttributes].substring[0,<def[entityAttributes].length.sub_int[1]>].split[;]>

  - foreach <def[entityAttributes]> {
    - if <def[value].contains[<el@val[=]>]> {
      - if <def[value].contains[custom_name]> {
        - define custom_name <def[value].split[<el@val[=]>].get[2]>
      }
      else if <def[value].contains[max_health]> {
        - define max_health <def[value].split[<el@val[=]>].get[2]>
      }
      else if <def[value].contains[health]> {
        - define health <def[value].split[<el@val[=]>].get[2]>
      }
      else if <def[value].contains[movementSpeed]> {
        - define movementSpeed <def[value].split[<el@val[=]>].get[2]>
      }
      else if <def[value].contains[attackDamage]> {
        - define attackDamage <def[value].split[<el@val[=]>].get[2]>
      }
      else if <def[value].contains[followRange]> {
        - define followRange <def[value].split[<el@val[=]>].get[2]>
      }
      else if <def[value].contains[knockbackResistance]> {
        - define knockbackResistance <def[value].split[<el@val[=]>].get[2]>
      }
      else if <def[value].contains[skeleton]> && <def[value].split[<el@val[=]>].get[2].is[==].to[WITHER]> {
        - define mobType "SkeletonType:1"
      }
      else if <def[value].contains[powered]> && <def[value].split[<el@val[=]>].get[2].is[==].to[true]> {
        # TODO: radius and fuse should be variables
        - define poweredCreeper "ExplosionRadius:3,Fuse:30,powered:1"
      }
      else if <def[value].contains[villager]> && <def[value].split[<el@val[=]>].get[2].is[==].to[true]> {
        - define isVillager "IsVillager:1"
      }
      else if <def[value].contains[age]> && <def[value].split[<el@val[=]>].get[2].is[==].to[baby]> {
        - define age "IsBaby:1"
      }
      else if <def[value].contains[skull]> {
        # TODO if player skull is taken, name "Xericore the Shadow" or something
        - define skull "id:skull,Damage:3,tag:{SkullOwner:<def[value].split[<el@val[=]>].get[2]>}"
      }
      else if <def[value].contains[jockey]> && <def[value].split[<el@val[=]>].get[2].is[==].to[true]> {
        - define jockey "Riding:{id:Chicken,IsChickenJockey:1}"
      }
    }
  }

  # need this to correctly support conversion of pig_zombie to PigZombie
  - define summonEntity <def[entity].entity_type.to_titlecase>

  # Only (Pig)Zombies and Skeletons will have equipment
  - if <def[entity].entity_type.is[==].to[SKELETON]> || <def[entity].entity_type.is[==].to[ZOMBIE]> || <def[entity].entity_type.is[==].to[PIG_ZOMBIE]> {

    - if <def[entity].entity_type.is[==].to[PIG_ZOMBIE]> {
      - define anger "Anger:32767"
      - define summonEntity PigZombie
    }
    - define equipChance <proc[lerp].context[equipRange|<def[difficulty]>|<def[isBoss]>]>

    - define equipAttributs <def[equip].split[/]>
    - foreach <def[equipAttributs]> {
      - if <util.random.decimal.is[OR_LESS].than[<def[equipChance]>]> || <def[entity].entity_type.is[==].to[SKELETON]> {
          # Skeletons always get weapons, otherwise they don't do anything.
          - define equip true
        }
        else {
          - define equip false
        }

      - if <def[value].contains[hand]> {
        # bosses always have weapons
          - if <def[isBoss]> || <def[equip]> {
            - define hand <proc[getItemWithDurability].context[<def[value]>|<def[difficulty]>|<def[isBoss]>]>
          }
        }
        else if <def[value].contains[head]> {
          # Equip helmet always to prevent mobs from burning at day (you could use fire resistance as well, but I like this better)
          - define head <proc[getItemWithDurability].context[<def[value]>|<def[difficulty]>|<def[isBoss]>]>
        }
        else if <def[value].contains[chest]> && <def[equip]> {
          - define chest <proc[getItemWithDurability].context[<def[value]>|<def[difficulty]>|<def[isBoss]>]>
        }
        else if <def[value].contains[legs]> && <def[equip]> {
          - define leggings <proc[getItemWithDurability].context[<def[value]>|<def[difficulty]>|<def[isBoss]>]>
        }
        else if <def[value].contains[boots]> && <def[equip]> {
          - define boots <proc[getItemWithDurability].context[<def[value]>|<def[difficulty]>|<def[isBoss]>]>
        }
        else if <def[value].contains[DropChances]> {
          - define DropChances <def[value]>
        }
      }
    }

  - execute <def[as_executor]> "summon <def[summonEntity]> <def[location].x> <def[location].y> <def[location].z>
    {Equipment:[
    {<tern[<def[hand].exists>]:<def[hand]>||>},
    {<tern[<def[boots].exists>]:<def[boots]>||>},
    {<tern[<def[leggings].exists>]:<def[leggings]>||>},
    {<tern[<def[chest].exists>]:<def[chest]>||>},
    {<tern[<def[skull].exists>]:<def[skull]>||<tern[<def[head].exists>]:<def[head]>||>>}]<tern[<def[custom_name].exists>]:,CustomName:<def[custom_name]>||>, Attributes <tern[<def[max_health].exists>]:{Name : generic.maxHealth,Base <def[max_health]>}||>
    <tern[<def[movementSpeed].exists>]:,
    {Name : generic.movementSpeed,Base <def[movementSpeed]>}||> <tern[<def[attackDamage].exists>]:,
    {Name : generic.attackDamage,Base <def[attackDamage]>}||> <tern[<def[followRange].exists>]:,
    {Name : generic.followRange,Base <def[followRange]>}||> <tern[<def[knockbackResistance].exists>]:,
    {Name : generic.knockbackResistance,Base <def[knockbackResistance]>}||>]
    <tern[<def[DropChances].exists>]:,<def[DropChances]>||><tern[<def[mobType].exists>]:,<def[mobType]>||>
    <tern[<def[anger].exists>]:,<def[anger]>||>
    <tern[<def[poweredCreeper].exists>]:,<def[poweredCreeper]>||>
    <tern[<def[age].exists>]:,<def[age]>||>
    <tern[<def[isVillager].exists>]:,<def[isVillager]>||>
    # The bracket and the quote and the end of the next line closes the quotes before the summon command
    <tern[<def[jockey].exists>]:,<def[jockey]>||>}"

getItemWithDurability:
  type: procedure
  definitions: item|difficulty|isBoss
  script:
  - define itemName <def[item].split[:].get[2]>
  - define maxDurability <i@%itemName%.max_durability>
  - define durabilityDifficulty <proc[lerp].context[itemDamaged|<def[difficulty]>|<def[isBoss]>]>

  - define randDurability <proc[gaussRand].context[<math:%durabilityDifficulty%*%maxDurability%>|0|%maxDurability%].round>
  - determine <i@%itemName%[durability=%randDurability%].json>

# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ #
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~   WEAPONS + ARMOR + LORE  ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ #
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ #
sword_1:
    type: item
    material: i@iron_sword
    display name: Buster Sword
    lore:
    - Old but still usable.
    enchantments: 
    - durability:2
    
sword_2:
    type: item
    material: i@gold_sword
    display name: Mystic Weapon
    lore:
    - A good looking weapon.
    enchantments: 
    - durability:3
    - damage_all:3
    
sword_3:
    type: item
    material: i@gold_sword
    display name: Hardedge
    lore:
    - A SOLDIER's old weapon.
    enchantments: 
    - durability:3
    - damage_all:4
    - fire_aspect:1

sword_4:
    type: item
    material: i@gold_sword
    display name: Butterfly Weapon
    lore:
    - A sleek weapon with a sturdy frame.
    enchantments: 
    - durability:3
    - fire_aspect:2
    - damage_all:4
    - knockback:1

sword_5:
    type: item
    material: i@iron_sword
    display name: Enhance sword
    lore:
    - This sword was forged in Gaeas Cliff.
    enchantments: 
    - durability:2
    - damage_undead:4
    
sword_6:
    type: item
    material: i@iron_sword
    display name: Organics
    lore:
    - It radiates a powerful energy.
    enchantments: 
    - durability:3
    - fire_aspect:1
    - damage_all:4
    
sword_7:
    type: item
    material: i@diamond_sword
    display name: Crystal Sword
    lore:
    - It looks very sharp.
    enchantments: 
    - damage_all:2
    
sword_8:
    type: item
    material: i@wood_sword
    display name: Nailbat
    lore:
    - It might look frail,
    - but it packs quite a punch.
    enchantments: 
    - durability:3
    - knockback:2
    - damage_all:5
    - LOOT_BONUS_MOBS:2
    
sword_9:
    type: item
    material: i@diamond_sword
    display name: Force Stealer
    lore:
    - It's hilt is very strong.
    enchantments: 
    - durability:1
    - DAMAGE_ARTHROPODS:4
    
sword_10:
    type: item
    material: i@diamond_sword
    display name: Rune Blade
    lore:
    - Seems to have originated
    - from a far away mountain.
    enchantments: 
    - durability:1
    - DAMAGE_UNDEAD:4
    - LOOT_BONUS_MOBS:1
    
sword_11:
    type: item
    material: i@diamond_sword
    display name: Murasame
    lore:
    - A slick and deadly weapon.
    enchantments: 
    - damage_all:4
    - knockback:2
    
sword_12:
    type: item
    material: i@diamond_sword
    display name: Yoshiyuki
    lore:
    - Looks just like a
    - japanese katana.
    enchantments: 
    - durability:1
    - DAMAGE_UNDEAD:5

sword_13:
    type: item
    material: i@diamond_sword
    display name: Apocalypse
    lore:
    - Will bring destruction
    - upon your enemies!
    enchantments: 
    - durability:2
    - DAMAGE_UNDEAD:4
    - fire_aspect:2
    - LOOT_BONUS_MOBS:1
    
sword_14:
    type: item
    material: i@diamond_sword
    display name: Heaven's Cloud
    lore:
    - A weapon thought to be long lost.
    enchantments: 
    - durability:3
    - knockback:1
    - DAMAGE_ALL:4
    - LOOT_BONUS_MOBS:1
    
sword_15:
    type: item
    material: i@diamond_sword
    display name: Ragnarok
    lore:
    - A beautiful blade that
    - makes you feel powerful.
    enchantments: 
    - durability:3
    - knockback:2
    - DAMAGE_ALL:4
    - LOOT_BONUS_MOBS:2
    - fire_aspect:1
    
sword_16:
    type: item
    material: i@diamond_sword
    display name: Ultima Weapon
    lore:
    - The ultimate weapon.
    enchantments: 
    - durability:3
    - damage_all:5
    - knockback:2
    - fire_aspect:2
    - loot_bonus_mobs:3
    
# --------------------------------------------------------------------------------------------------------------------#
# -------------------------------------------       BOWS            --------------------------------------------------#
# --------------------------------------------------------------------------------------------------------------------#
bow_1:
    type: item
    material: i@bow
    display name: Normal
    lore:
    - Normal bow.
    enchantments: 
    - durability:2
    
bow_2:
    type: item
    material: i@bow
    display name: Good Bow
    lore:
    - A really good bow.
    enchantments: 
    - arrow_damage:1
    - durability:2
    
bow_3:
    type: item
    material: i@bow
    display name: Great Bow
    lore:
    - A really great bow.
    enchantments: 
    - arrow_damage:2
    - durability:3
    
bow_4:
    type: item
    material: i@bow
    display name: Knocker Bow
    lore:
    - Rock you like a hurricane!
    enchantments: 
    - durability:2
    - arrow_damage:3
    - arrow_knockback:1
    
bow_5:
    type: item
    material: i@bow
    display name: Fire Bow
    lore:
    - Asses of fire!
    enchantments: 
    - durability:2
    - arrow_damage:3
    - arrow_knockback:2
    - arrow_fire:1
    
bow_6:
    type: item
    material: i@bow
    display name: Excellent Bow
    lore:
    - A really excellent bow.
    enchantments: 
    - durability:3
    - arrow_damage:4
    - arrow_fire:1
    - arrow_knockback:2
    - arrow_infinite:1
    
ultimabow:
    type: item
    material: i@bow
    display name: Ultima Bow
    lore:
    - Simple the ultimate bow.
    enchantments: 
    - arrow_infinite:1
    - arrow_fire:1
    - arrow_knockback:2
    - arrow_damage:5

# --------------------------------------------------------------------------------------------------------------------#
# -------------------------------------------       HELMETS         --------------------------------------------------#
# --------------------------------------------------------------------------------------------------------------------#
helmet_1:
    type: item
    material: i@chainmail_helmet
    display name: Old Helmet
    lore:
    - Looks (r)old.
    enchantments: 
    - durability:2

helmet_2:
    type: item
    material: i@chainmail_helmet
    display name: Fine Helmet
    lore:
    - A really nice helmet. All glowy and stuff.
    enchantments: 
    - durability:3
    - PROTECTION_FIRE:2
    
helmet_3:
    type: item
    material: i@chainmail_helmet
    display name: Sturdy Helmet
    lore:
    - It is very thick.
    enchantments: 
    - PROTECTION_ENVIRONMENTAL:3
    - durability:3
    
helmet_4:
    type: item
    material: i@gold_helmet
    display name: Anti Arrow Helmet
    lore:
    - Still better to dodge those projectiles.
    enchantments: 
    - PROTECTION_PROJECTILE:4
    - durability:3

helmet_5:
    type: item
    material: i@gold_helmet
    display name: Super Gold Helmet
    lore:
    - Looks like it<&sq>s got some holes,
    - but still useable. 
    enchantments: 
    - PROTECTION_ENVIRONMENTAL:4
    - durability:3
    
helmet_6:
    type: item
    material: i@gold_helmet
    display name: Scuba Diver
    lore:
    - Waterboarding sounds more fun
    - than it actually is!
    enchantments: 
    - WATER_WORKER:1
    - oxygen:2
    - durability:3
    
helmet_7:
    type: item
    material: i@iron_helmet
    display name: I don<&sq>t like ships
    lore:
    - Player has left the game.
    enchantments: 
    - oxygen:3
    - durability:3
    
helmet_8:
    type: item
    material: i@iron_helmet
    display name: Shiny Brighty
    lore:
    - Oldie but goldie.
    enchantments: 
    - durability:3
    - thorns:1
    
helmet_9:
    type: item
    material: i@iron_helmet
    display name: Iron Giving Head
    lore:
    - Pun intended!
    enchantments: 
    - durability:3
    - PROTECTION_EXPLOSIONS:4
    
helmet_10:
    type: item
    material: i@diamond_helmet
    display name: I like it cold
    lore:
    - You<&sq>re hot and you<&sq>re cold.
    - You<&sq>re yes and you<&sq>re no...
    enchantments: 
    - durability:2
    - PROTECTION_FIRE:3
    
helmet_11:
    type: item
    material: i@diamond_helmet
    display name: Sturdy Diamond Helmet
    lore:
    - Good craftsmenship.
    enchantments: 
    - PROTECTION_ENVIRONMENTAL:3
    - durability:1
    
helmet_12:
    type: item
    material: i@diamond_helmet
    display name: Iron Helmet of Doom
    lore:
    - How can a helmet sound so dangerous?
    enchantments: 
    - durability:2
    - PROTECTION_EXPLOSIONS:5
    
helmet_13:
    type: item
    material: i@diamond_helmet
    display name: Fahrradhelm
    lore:
    - Is actually better than it sounds.
    enchantments: 
    - durability:1
    - PROTECTION_ENVIRONMENTAL:4
   
helmet_14:
    type: item
    material: i@diamond_helmet
    display name: Diamond Helmet
    lore:
    - A normal diamond helmet...
    - ...almost.
    enchantments: 
    - PROTECTION_FIRE:3
    - oxygen:1
    - durability:2
   
helmet_15:
    type: item
    material: i@diamond_helmet
    display name: Diamondo do Pearl
    lore:
    - I like the Japanese!
    enchantments: 
    - durability:3
    - oxygen:2
    - thorns:1
    - PROTECTION_EXPLOSIONS:4
    
helmet_16:
    type: item
    material: i@diamond_helmet
    display name: Beautiful Helmet
    lore:
    - It<&sq>s got engravings <&sq>n shit!
    enchantments: 
    - durability:3
    - thorns:2
    - PROTECTION_ENVIRONMENTAL:4
    
helmet_17:
    type: item
    material: i@diamond_helmet
    display name: Awesome-O Helmet
    lore:
    - You won<&sq>t find a better one.
    enchantments: 
    - WATER_WORKER:1
    - oxygen:3
    - PROTECTION_ENVIRONMENTAL:4
    - thorns:3
    
# --------------------------------------------------------------------------------------------------------------------#
# -------------------------------------------     CHESTPLATES       --------------------------------------------------#
# --------------------------------------------------------------------------------------------------------------------#
chestplate_1:
    type: item
    material: i@chainmail_chestplate
    display name: Normal Armor
    lore:
    - Old but still usable.
    enchantments: 
    - durability:2
    
chestplate_2:
    type: item
    material: i@chainmail_chestplate
    display name: Fine Armor
    lore:
    - Well done armor.
    enchantments: 
    - durability:3
    - PROTECTION_PROJECTILE:2
    
chestplate_3:
    type: item
    material: i@gold_chestplate
    display name: Chesthair
    lore:
    - Noone shaved their chesthair in medieval times!
    - Neither should you, peasent!
    enchantments: 
    - durability:3
    - PROTECTION_ENVIRONMENTAL:3
    
chestplate_4:
    type: item
    material: i@gold_chestplate
    display name: Excellent Armor
    lore:
    - The best leather in town.
    enchantments: 
    - durability:3
    - PROTECTION_ENVIRONMENTAL:3
    - THORNS:2
    
chestplate_5:
    type: item
    material: i@gold_chestplate
    display name: Armor of Rol
    lore:
    - Don<&sq>t tell him about this!
    enchantments: 
    - durability:3
    - PROTECTION_FIRE:4
    - thorns:3
    
chestplate_6:
    type: item
    material: i@iron_chestplate
    display name: Stay away from me!
    lore:
    - Spiky armor.
    enchantments: 
    - durability:1
    - PROTECTION_ENVIRONMENTAL:3
    - THORNS:1
    
chestplate_7:
    type: item
    material: i@iron_chestplate
    display name: Protectorol
    lore:
    - Will get you in and out of trouble.
    enchantments: 
    - durability:2
    - PROTECTION_EXPLOSIONS:3
    
chestplate_8:
    type: item
    material: i@iron_chestplate
    display name: Antifa I
    lore:
    - Stands for anti-faijr!
    enchantments: 
    - durability:3
    - PROTECTION_FIRE:4
    
chestplate_9:
    type: item
    material: i@diamond_chestplate
    display name: Antifa II
    lore:
    - Stands for anti-faijr version II!
    enchantments: 
    - durability:2
    - PROTECTION_FIRE:4
    
chestplate_10:
    type: item
    material: i@diamond_chestplate
    display name: Come get some 
    lore:
    - You won<&sq>t get me alive.
    enchantments: 
    - durability:2
    - PROTECTION_EXPLOSIONS:2
    - THORNS:3
    
chestplate_11:
    type: item
    material: i@diamond_chestplate
    display name: Excellento
    lore:
    - Created by an excellent blacksmith.
    enchantments: 
    - durability:2
    - PROTECTION_PROJECTILE:3
    - THORNS:1
    
chestplate_12:
    type: item
    material: i@diamond_chestplate
    display name: Wolfmaster
    lore:
    - Has absolutely nothing
    - to do with wolves.
    enchantments: 
    - durability:2
    - PROTECTION_FIRE:3
    - THORNS:1
    
chestplate_12:
    type: item
    material: i@diamond_chestplate
    display name: Bartolomeo
    lore:
    - Like an impenetrable barrier!
    enchantments: 
    - durability:2
    - PROTECTION_ENVIRONMENTAL:3
    - thorns:2

chestplate_13:
    type: item
    material: i@diamond_chestplate
    display name: Resto Chesto
    lore:
    - Good for Snorlax!
    enchantments: 
    - durability:3
    - PROTECTION_PROJECTILE:4
    - THORNS:3
    
chestplate_14:
    type: item
    material: i@diamond_chestplate
    display name: Savior X
    lore:
    - You don<&sq>t like to get hurt?
    - Well, me neither!
    enchantments: 
    - durability:3
    - PROTECTION_EXPLOSIONS:4
    - THORNS:3
    
chestplate_15:
    type: item
    material: i@diamond_chestplate
    display name: Ziedrich
    lore:
    - Stolen from Reno in Gelnika.
    enchantments: 
    - durability:3
    - PROTECTION_FIRE:4
    - THORNS:3
    
chestplate_15:
    type: item
    material: i@diamond_chestplate
    display name: Mystil
    lore:
    - Like heavens cloud!
    enchantments: 
    - durability:3
    - PROTECTION_ENVIRONMENTAL:4
    - THORNS:3

# --------------------------------------------------------------------------------------------------------------------#
# -------------------------------------------      LEGGINGS         --------------------------------------------------#
# --------------------------------------------------------------------------------------------------------------------#
leggings_1:
  type: item
  material: i@chainmail_leggings
  display name: Starter
  lore: 
  - It<&sq>s all about starting.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:1
  
leggings_2:
  type: item
  material: i@chainmail_leggings
  display name: Flyweight
  lore: 
  - Still you cannot fly.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:2
  
leggings_3:
  type: item
  material: i@gold_leggings
  display name: Antifa I
  lore: 
  - Anti-faijr Version 1.0
  enchantments:
  - durability:3
  - PROTECTION_FIRE:4
  
leggings_4:
  type: item
  material: i@gold_leggings
  display name: Lightweight
  lore: 
  - Now you can start fighting.
  enchantments:
  - durability:3
  - PROTECTION_PROJECTILE:4
  
leggings_5:
  type: item
  material: i@iron_leggings
  display name: Welterweight
  lore: 
  - It<&sq>s worth a try.
  enchantments:
  - durability:1
  - PROTECTION_EXPLOSIONS:3
  
leggings_6:
  type: item
  material: i@iron_leggings
  display name: Middleweight
  lore: 
  - Still useful.
  enchantments:
  - durability:3
  - PROTECTION_PROJECTILE:4
  
leggings_7:
  type: item
  material: i@diamond_leggings
  display name: Heavyweight
  lore: 
  - That<&sq>s what I<&sq>m talking about.
  enchantments:
  - durability:1
  - PROTECTION_ENVIRONMENTAL:2
  
leggings_8:
  type: item
  material: i@diamond_leggings
  display name: Rare Jewel
  lore: 
  - You<&sq>ll be the prettiest.
  enchantments:
  - durability:2
  - PROTECTION_PROJECTILE:3
  
leggings_9:
  type: item
  material: i@diamond_leggings
  display name: Casanova
  lore: 
  - Don<&sq>t play with the undead.
  enchantments:
  - durability:2
  - PROTECTION_EXPLOSIONS:4

leggings_10:
  type: item
  material: i@diamond_leggings
  display name: Priceless
  lore: 
  - The glance blinds enemies.
  enchantments:
  - durability:3
  - PROTECTION_PROJECTILE:4
  
leggings_11:
  type: item
  material: i@diamond_leggings
  display name: Champion
  lore: 
  - You are worthy wearing these.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:4
  - thorns:2
  
leggings_12:
  type: item
  material: i@diamond_leggings
  display name: Ultima Leggings
  lore: 
  - The best available on the market.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:4
  - thorns:3
  
# --------------------------------------------------------------------------------------------------------------------#
# -------------------------------------------       BOOTS           --------------------------------------------------#
# --------------------------------------------------------------------------------------------------------------------#
boots_1:
  type: item
  material: i@chainmail_boots
  display name: Beginner
  lore:: 
  - Safety first.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:2

boots_2:
  type: item
  material: i@chainmail_boots
  display name: Stingray
  lore:
  - You schould not touch anyone.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:1
  - THORNS:1
  
boots_3:
  type: item
  material: i@gold_boots
  display name: Lightweight
  lore:
  - As light as a feather.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:3
  - DEPTH_STRIDER:2
  
boots_4:
  type: item
  material: i@gold_boots
  display name: Traveler
  lore:
  - Let<&sq>s kick some ass in hell.
  enchantments:
  - durability:3
  - PROTECTION_FIRE:3
  - PROTECTION_FALL:3
  
boots_5:
  type: item
  material: i@iron_boots
  display name: Middleweight
  lore:
  - The golden mean.
  enchantments:
  - durability:2
  - PROTECTION_ENVIRONMENTAL:3
  - DEPTH_STRIDER:1

boots_6:
  type: item
  material: i@iron_boots
  display name: Heavyweigth
  lore:
  - Take it easy.
  enchantments:
  - PROTECTION_ENVIRONMENTAL:4
  - durability:3
  
boots_7:
  type: item
  material: i@diamond_boots
  display name: Adventurer
  lore:
  - Perfect for exploring the whole map.
  enchantments:
  - PROTECTION_FALL:3
  - PROTECTION_EXPLOSIONS:2
  - DEPTH_STRIDER:3

boots_8:
  type: item
  material: i@diamond_boots
  display name: Hell Walker
  lore:
  - Perfect for the undead.
  enchantments:
  - durability:2
  - PROTECTION_FALL:2
  - PROTECTION_FIRE:4

boots_9:
  type: item
  material: i@diamond_boots
  display name: BOOM
  lore:
  - Let<&sq>s kill some Creeper.
  enchantments:
  - durability:2
  - PROTECTION_EXPLOSIONS:4
  - PROTECTION_FALL:2

boots_10:
  type: item
  material: i@diamond_boots
  display name: Swimmer
  lore:
  - With these you can almost swim in lava.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:4
  - PROTECTION_FALL:3
  - DEPTH_STRIDER:1
 
boots_11:
  type: item
  material: i@diamond_boots
  display name: Lighting Boots
  lore:
  - Deadly and fast like lightning.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:4
  - PROTECTION_FALL:3
  - DEPTH_STRIDER:2
  - THORNS:2

boots_12:
  type: item
  material: i@diamond_boots
  display name: Ultima Boots
  lore:
  - Now you are unstoppable.
  enchantments:
  - durability:3
  - PROTECTION_ENVIRONMENTAL:4
  - PROTECTION_FALL:4
  - DEPTH_STRIDER:3
  - THORNS:3
   





View History