# 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>
Uneven number of "quotes"
{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]>||>}"
Uneven number of "quotes"
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