Zone Files and Stages
On this page(8)
Each zone is one file of modules/zones/zones/. It names the zone, holds its spawn, its mob area and its NPC, and lists its stages with their price and mob. You add a zone by adding a file, and remove one by deleting it.
| Files | modules/zones/zones/<id>.yml, one per zone (the shipped example is barn.yml) |
| Written by | You, plus /dungeons admin zones setspawn, setarea and setnpc |
| Applied by | /dungeons reload |
| Order | zones-order of modules/zones/config.yml |
How zone files work
- The id is the file name.
barn.ymlis the zonebarn. An id is lowercase letters, digits and-, at most 59 characters, with the extension.yml. - The example. The folder is created with
barn.ymlonly when it does not exist as the module enables. A single file you delete never comes back. - Adding and removing. Copy a file under a new name to add a zone, or delete one to remove it.
/dungeons reloadapplies either. - The order. List the id in
zones-orderto place the zone in the progression. A file missing from the list goes after the listed ones, with a warning. - The file is yours. SnDungeons never updates it, so a key you delete reads its default.
Three admin commands write into the file: setspawn (the spawn), setarea (the mob-area) and setnpc (the npc). Each one rewrites the whole file from what was loaded last.
After editing a zone file by hand, run /dungeons reload BEFORE you use setspawn, setarea or setnpc on that zone. Otherwise they write back the old content over your edit.
Some files cannot be read at startup: a YAML error, no stage, or a file name in another case. Such a file keeps its players' progress. They cannot use /zone (its status, go, buy, max, next and back) until it reads again. A file that breaks after it loaded keeps its last good content. A file with no key at all (empty, or only comments) is skipped with a warning.
Root keys
| Key | Default | What it does |
|---|---|---|
name | the id | The name shown in messages and menus. Color codes and &#rrggbb hex are allowed. |
spawn | none | Where /zone go, /zone back, /zone next and a purchase take the player, for every stage of this zone. Written as world,x,y,z,yaw,pitch or world,x,y,z. setspawn writes it. |
mob-area | none | The box where each player sees the mobs of their stage. Without it the zone shows no mobs. See Mob Areas. |
npc | none | The NPC that throws the new mobs. Without it the new mobs appear in place. See Zone NPC and Mob Refresh. |
stages | required | The stages, by number. A file without a readable stage is not a zone. |
The spawn. A zone has one spawn, and every stage of the zone uses it. Moving between two stages of the same zone teleports you to the same spot, and only the mobs change. A zone without a spawn, or whose spawn world is not loaded, teleports nobody.
The spawn should be in the world of the mob-area, because the mobs show only there. A spawn in another world is reported in the console.
An older zone file may still have a spawn inside each stage. A file without a root spawn uses the spawn of its lowest stage that has one. It warns each time it is read. A file with both uses the root spawn and names the ignored stage spawns. setspawn removes the stage spawns.
The look of the zone in /zones is not in this file. It lives in modules/zones/guis/zones.yml (the items <id>-current, <id>-unlocked, <id>-next and <id>-locked). See Zones.
Stages
stages: holds one section per stage. Its key is the stage number: a whole number of 1 or more, quoted ('1'). Players unlock the stages in order, from the lowest number up.
| Key | Default | What it does |
|---|---|---|
cost | free, with a warning | The price of the stage, 0 or more. Amounts take the suffixes of currencies.number-format (15K) or an exponent (2e40). Quote an amount past 1.8e308 ('1e500'). |
currency | default-currency | The currency id the stage is paid with. An unknown id is a warning, and the stage cannot be bought until that currency exists. |
mob | none | The mob players at this stage see in the mob area. Without it the stage shows no mobs. |
The lowest stage of the first zone of zones-order is where every player starts, so its cost is never charged. A missing, unreadable or negative cost makes the stage free, with a warning. A stage key that is not a number, or repeats a number, is skipped with a warning.
The mob of a stage
| Key | Default | What it does |
|---|---|---|
mob.type | required | A living entity type that can be spawned: CHICKEN, COW, ZOMBIE... Any case, a minecraft: prefix works. PLAYER is refused. |
mob.name | the type's name | The {mob} of mobs.name-format, color codes allowed. Without it, CAVE_SPIDER reads Cave Spider. |
mob.health | 20, with a warning | The health before the rarity bonus, more than 0. Amounts like 1.5K work. |
mob.rewards | none | What each kill pays: an amount per currency id, such as money: 100. Amounts like 1.5K work. |
mob.model | none | A model shown instead of the type's look. The type stays the hitbox and keeps every mob rule. See Models. |
A mob whose type is missing or wrong is a warning, and the stage shows no mobs. The rest of the zone keeps working.
Rewards. A kill pays each amount x (1 + the rarity's reward-bonus / 100) x the player's booster total of that currency. Each currency is logged as a gain with the cause mob-kill. An amount of 0 pays nothing, and a negative one is skipped with a warning. An unknown currency is kept with a warning, and pays nothing until it exists. See Fighting and Rarities and Boosters.
Models. The short model: forms name an item or an engine model. An item is 'paper:1001' (custom model data) or 'paper:my_pack:goblin' (an item model). An engine model is 'bm:<id>' (BetterModel) or 'meg:<id>' (ModelEngine). An engine that is not installed shows the vanilla look, with one warning. The block form names the model (item:, bettermodel: or modelengine:) and adds scale, height, hitbox-scale, yaw-offset, render and animations. The commented example of barn.yml uses it. See Models.
mob:
type: CHICKEN
name: 'Chicken'
health: 116
model:
bettermodel: chicken_knight
scale: 1.0
animations:
idle: idle
hurt: hitThe shipped barn zone
barn.yml has ten stages. Stages 1 to 4 are a chicken, a rabbit, a sheep and a pig, then come farm animals as examples. Each price is about 55 times the one before (15K for stage 2, up to 1.26e18 for stage 10). Each health is about 29 times the one before (116 for stage 1). The experience reward doubles every stage, from 1 to 512.
Its mob-area and npc ship commented out, because their coordinates depend on your world. Mark yours with the wand and setnpc.
Example: a new zone
A minimal second zone. spawn, mob-area and npc are left to the admin commands.
modules/zones/zones/mine.yml
# The zone id is the file name: mine
name: '&7&lMine' # shown in messages and menus
spawn: 'dungeons,200.5,64,0.5,180,0' # world,x,y,z,yaw,pitch; setspawn writes it
stages:
'1':
cost: '7e19' # the price; 7e19 or a suffix such as 15K
mob:
type: ZOMBIE # a living entity type
name: 'Miner' # the {mob} of mobs.name-format
health: '4.9e16' # before the rarity bonus
rewards: # paid on every kill, per currency id
money: '4.2e16'
experience: 1024
'2':
cost: '3.9e21'
currency: souls # this stage is paid in souls, not default-currency
mob:
type: HUSK
name: 'Deep Miner'
health: '1.4e18'
rewards:
money: '1.2e18'
souls: 5
experience: 2048Adding a zone and placing it in game
- Create
modules/zones/zones/mine.yml(copybarn.ymlor start from the example above). Set itsnameandstages. - Add the id to
zones-orderinmodules/zones/config.yml:zones-order: ['barn', 'mine']. - Run
/dungeons reload. Check it with/dungeons admin zones list. - Stand at the zone spawn and run
/dungeons admin zones setspawn mine. - Run
/dungeons admin zones wand, left click one corner and right click the other, then/dungeons admin zones setarea mine. See Mob Areas. - Optional: stand where the NPC goes and run
/dungeons admin zones setnpc mine Notch. See Zone NPC and Mob Refresh. - Optional: edit
max-mobsand the two distances ofmob-areaby hand, then/dungeons reload. - Give the zone a tile in
modules/zones/guis/zones.yml. Copy the fourbarn-*items, rename themmine-*, and replacebarnwithminein their placeholders and actions. Give them a free letter (key: b) and put that letter on the layout ("aaa.bbb.."on two rows). - Test it:
/dungeons admin zones setprogress <you> mine 1, then/zone go.
Keep the spawn, the mob area and the NPC of a zone in one world. Put that world in isolation.worlds to hide the other players there (see Isolated Zone Worlds).
Default modules/zones/zones/barn.yml
# ============================================================
# SnDungeons - zone file (barn)
# One file per zone; the zone id is the file name (barn.yml = barn):
# lowercase letters, digits and '-', at most 59 characters, extension .yml.
# List the id in zones-order of modules/zones/config.yml to place the zone
# in the progression. Copy this file under a new name to add a zone, delete
# it to remove one; /dungeons reload applies either.
# SnDungeons never updates this file, so a key you delete reads its
# default; the only exceptions are /dungeons admin zones setspawn barn,
# which writes the zone spawn here (one zone = one spawn, shared by all its
# stages) and removes any spawn a stage still has, and
# /dungeons admin zones setarea barn, which writes the mob-area. Both
# rewrite the whole file from what was loaded last: run /dungeons reload
# after editing it by hand, before using setspawn or setarea on this zone.
# A zone file that cannot be read at startup (a YAML error, no stage, a file
# name in another case) keeps the players who reached it from using /zone
# (its status, go, buy, max, next and back) until it reads again; one that
# breaks later keeps its last good content.
# The example file is created only when the zones module enables while the
# zones folder does not exist; a single deleted file never comes back.
# ============================================================
# Name shown in messages and menus (color codes and &#rrggbb hex allowed); the
# id when absent.
name: ':d62c&lBarn &#b6fdb0&lZone'
# The look of the zone in the /zones menu lives in modules/zones/guis/zones.yml
# (its items barn-current, barn-unlocked, barn-next and barn-locked).
# Where /zone go, /zone back, /zone next and a purchase take the player, for
# every stage of this zone: world,x,y,z,yaw,pitch (or world,x,y,z). Stand
# there and run /dungeons admin zones setspawn barn to write it. A zone file
# without it whose stages still have a spawn each (the form of 0.10.0 and
# before) uses the spawn of its lowest stage that has one, with a warning.
spawn: 'world,0.5,64,0.5,180,0'
# The box where each player sees the mobs of the stage they are at (the mob
# of each stage below). Hold the wand of /dungeons admin zones wand, left click
# one corner block and right click the opposite one, then run
# /dungeons admin zones setarea barn: it writes world, min and max here (and
# the three numbers below when they are missing); the marks disappear once
# setarea writes the area. The world must be the one of the zone spawn (the
# example spawn is in 'world'; the isolated world of
# modules/zones/config.yml is 'dungeons'). Without a mob-area the zone shows
# no mobs. Edit max-mobs and the two distances by hand and /dungeons reload to
# apply them.
# mob-area:
# world: world
# min: '10,64,10'
# max: '60,70,60'
# # How many mobs each player sees at most (0 to 200; fewer when no more
# # fit the distances or a placement runs out of draws).
# max-mobs: 20
# # Blocks kept free between a mob and the edge of the box.
# min-border-distance: 2
# # Least distance between two mobs, in blocks.
# min-mob-distance: 3
# The NPC of the zone: a fake player only each player sees (never in the tab
# list) that throws the new mobs of the mob-area (see npc-launch of
# modules/zones/config.yml). Stand where it goes, facing where it looks, and
# run /dungeons admin zones setnpc barn to write location (in the world of the
# mob-area); setnpc barn <player> also writes skin.player. It rests facing the
# side of mobs.facing (npc-launch.rest-facing of modules/zones/config.yml;
# the yaw below with file or with RANDOM) and turns toward each mob it
# throws. Without an npc the new mobs appear in place.
# npc:
# location:
# world: world
# x: 10.5
# y: 64
# z: 3.5
# yaw: 90
# pitch: 0
# # Name shown above it (color codes allowed) when name-visible is true;
# # missing name-visible = false (no name above it).
# name: '&6&lFarmer'
# name-visible: false
# # The skin: skin.player is the skin of a Minecraft account (looked up once;
# # needs the server, or its proxy, in online mode), or a Mojang texture
# # with its signature (any server):
# # skin: { texture: '<value>', signature: '<signature>' }
# skin:
# player: 'Notch'
# The stages of the zone, by number (1 or more; keep the numbers quoted).
# Players unlock them in order, from the lowest number up. The lowest stage of
# the first zone of zones-order is where every player starts, so its cost is
# never charged.
stages:
'1':
# Price of the stage (0 or more). Amounts accept the suffixes of
# currencies.number-format in config.yml (15K) or an exponent (2e40).
cost: 0
# The mob the players at this stage see in the mob-area: type (a living
# entity type: CHICKEN, COW, ZOMBIE, ...), name (the {mob} of name-format
# in modules/zones/config.yml; the type when absent), health (before the
# rarity bonus; amounts like 1.5K work) and rewards (what each kill pays:
# an amount per currency id of the currencies folder, plus the reward-bonus
# of the mob's rarity in modules/zones/config.yml; none when absent).
# Without a mob the stage shows no mobs.
mob:
type: CHICKEN
name: 'Chicken'
health: 116
rewards:
money: 100
experience: 1
# Optional model shown instead of the type's look (0.48.0). The type stays
# the hitbox and every mob rule. Forms: an item ('paper:1001' custom model
# data, 'paper:my_pack:goblin' item model, or an item: block) or an engine
# model ('bm:<id>' BetterModel, 'meg:<id>' ModelEngine; the plugin must be
# installed, else the vanilla look with one WARN). Block keys: scale,
# height (the name and aim height, 0 = the type's), hitbox-scale,
# yaw-offset, render (default | packet | entity) and animations (idle,
# walk, attack, hurt, death, spawn). README "Models" has every key.
# model:
# bettermodel: chicken_knight
# scale: 1.0
# animations:
# idle: idle
# hurt: hit
'2':
cost: '15K'
# Currency of this stage (an id of the currencies folder); without this
# key the default-currency of modules/zones/config.yml applies.
currency: money
mob:
type: RABBIT
name: 'Rabbit'
health: '3.36K'
rewards:
money: '2.9K'
experience: 2
'3':
cost: '825K'
mob:
type: SHEEP
name: 'Sheep'
health: '97.56K'
rewards:
money: '84K'
experience: 4
'4':
cost: '45.38M'
mob:
type: PIG
name: 'Pig'
health: '2.83M'
rewards:
money: '2.44M'
experience: 8
# Stages 5 to 10: example prices (each about 55 times
# the one before); the mobs are examples (each health about 29 times the one
# before), and so are their rewards.
'5':
cost: '2.5B'
mob:
type: COW
name: 'Cow'
health: '82.07M'
rewards:
money: '70.7M'
experience: 16
'6':
cost: '137.26B'
mob:
type: GOAT
name: 'Goat'
health: '2.38B'
rewards:
money: '2.05B'
experience: 32
'7':
cost: '7.55T'
mob:
type: MOOSHROOM
name: 'Mooshroom'
health: '69.02B'
rewards:
money: '59.5B'
experience: 64
'8':
cost: '415.21T'
mob:
type: LLAMA
name: 'Llama'
health: '2.0T'
rewards:
money: '1.72T'
experience: 128
'9':
cost: '2.284e16'
mob:
type: HORSE
name: 'Horse'
health: '58.05T'
rewards:
money: '50T'
experience: 256
'10':
cost: '1.26e18'
mob:
type: IRON_GOLEM
name: 'Iron Golem'
health: '1.68e15'
rewards:
money: '1.45e15'
experience: 512