Fighting and Rarities
On this page(15)
Players fight their zone mobs with their sword. One click picks a target, then the sword hits it on its own at the player's swing rate until it dies. Every mob rolls a rarity that changes its outline, its health and its rewards.
| Files | mobs: of modules/zones/config.yml (the fight, rarities, boss bar, hologram); combat: of modules/sword/config.yml (damage, swings, reach) |
| Settings | zones.target-bar (the boss bar), zones.damage-numbers (the damage hologram) |
| Needs | The packet layer (nms.enabled: true in config.yml) |
How a fight works
- Pick a target. Attack (left click) one of your zone mobs with your own sword in your main hand. Stand inside the columns of that zone's mob area, or at most
mobs.leave-area-distanceblocks out of them. Stand withincombat.hit-distanceof the mob (6 blocks as shipped). - The sword swings on its own. Per second it hits
combat.swings-per-second+ your tier'sswings-per-secondtimes, plus your level swings. Your swings booster total multiplies that, andcombat.max-swings-per-secondcaps it. - Each hit takes
combat.base-damagex your tier'sdamage-multiplierx your damage booster total from the mob's health. The{health}of its name goes down. - One target at a time. Attacking another of your mobs moves the target there. The old one keeps the health it has left. Clicking faster adds nothing: the hits follow your own rhythm, and a new target does not restart it.
- The mob dies. It plays its death and disappears.
mobs.respawn-secondsafter the death, a new mob of the same stage appears at another place of the area. It keeps the area's distances, rolls its rarity again and has full health. With no free place, it tries again every second. - Pick again. The next target is never picked for you.
The swing and damage keys are in the combat: block of the sword. See Sword for the math and every key.
When the hits stop
- the mob dies;
- you are farther than
combat.hit-distancefrom it, or thanmobs.leave-area-distancefrom the area's columns (height does not count); - you leave its world, change stage, die or quit;
- you hold anything but your sword: another slot or an empty hand (with
combat.stop-on-unequip: falsethe hits go on); - the mob refresh replaces the mob (see Zone NPC and Mob Refresh);
- the sword or zones module is turned off, or the packet layer is off;
- a
/dungeons reloadchangesmobs.bossbar,mobs.damage-hologram,mobs.hurt-flashormobs.leave-area-distance.
Rewards per kill
Every kill pays the rewards of the stage's mob (see Zone Files and Stages):
paid = reward x (1 + reward-bonus / 100) x the player's booster total of that currencyEach currency is logged as a gain with the cause mob-kill, summed per currencies.log.aggregate-window-seconds. A currency that is not loaded pays nothing. The shipped mobs pay experience, which raises the level track, and each level gained adds combat.swings-per-level swings per second. See Boosters.
What only you see
The whole fight is sent to you alone: your mobs, their hits, deaths and respawns, the boss bar and the damage texts. A player who visits you sees your mobs and damage texts, never your boss bar.
- No arm swing. The automatic hits send no extra click, so an anti-cheat or Paper's packet limiter has nothing to count. Nobody sees your arm move with them.
- Click spam. At most 8 clicks per player wait for the server at once. A spammer cannot slow the others down.
- Health is memory only. A stage change, a world change, a rejoin or the module going off shows every mob again at full health. A
/dungeons reloadgives you new mobs only when what you see changed.
Amounts keep 15 significant digits. A hit below the 15th digit of a mob's health takes nothing. Keep base-damage x damage-multiplier within 15 digits of your stage healths.
Enchants in the fight
While you fight, the enchants of your sword can proc and hit your mobs too. Their damage counts for the boss bar and the damage hologram like your swings. See How Enchants Work.
Rarities
Every mob rolls one rarity of mobs.rarities when it appears. chance is a weight: a rarity is picked with probability chance / (sum of every chance).
| Rarity | chance | glow | health-bonus | reward-bonus | prefix | Odds |
|---|---|---|---|---|---|---|
common | 70 | NONE | 0 | 0 | '' | about 69.3% |
rare | 15 | AQUA | 100 | 100 | '&b[RARE] ' | about 14.9% |
epic | 10 | PURPLE | 200 | 200 | '&5[EPIC] ' | about 9.9% |
legendary | 5 | YELLOW | 300 | 300 | '&e[LEGENDARY] ' | about 5% |
boss | 1 | RED | 600 | 600 | '&r&l[BOSS] ' | about 1% |
The shipped chances add up to 101. A boss has a red outline, 600% more health and 600% more rewards.
| Key of a rarity | Default | What it does |
|---|---|---|
chance | 0, with a warning | The weight, 0 or more. 0 = never rolled. When no rarity has a chance above 0, every mob is plain. |
glow | NONE | The color of the mob's outline: a color name (AQUA, YELLOW, DARK_PURPLE, GOLD...) or NONE. PURPLE is the same as DARK_PURPLE. |
health-bonus | 0 | A percentage added to the stage's health. 100 doubles it. |
reward-bonus | 0 | A percentage added to every reward of the mob. 100 doubles them. |
prefix | '' | The {rarity-prefix} of the mob's name and boss bar. |
rarities is marked # sn:extensible: the entries are yours. Add, rename or delete rarities freely, and SnLib never puts a deleted one back.
rarities:
# ...the shipped rarities...
mythic:
chance: 0.5
glow: LIGHT_PURPLE
health-bonus: 1000
reward-bonus: 1000
prefix: '&d&l[MYTHIC] 'The shipped boss prefix has no color of its own. Its red comes from the outline: the outline team tints any part of the name without a color. Start mobs.name-format with a color code to keep the other parts white.
The Luck effect better-mob-rarity gives a lucky player the better of two rarity rolls.
The mob name
mobs.name-format is the name shown above each mob, color codes allowed:
| Token | Value |
|---|---|
{rarity-prefix} | The prefix of its rarity |
{stage} | The stage number |
{mob} | The name of the stage's mob |
{health} | The health it has left: the stage's health plus the rarity's bonus until it is hit, in currencies.number-format |
With the shipped values, a rare chicken of stage 1 with health 116 reads [RARE] LVL1 Chicken ❤232.
Boss bar
While you have a target, you see a boss bar of it, yours alone. It empties with the mob's health, from your swings and your enchants alike. It goes when the mob dies or the fight ends, and moves to the new mob when you attack another one. Players can hide it with the setting zones.target-bar.
| Key | Default | What it does |
|---|---|---|
mobs.bossbar.enabled | true | false shows no boss bar. |
mobs.bossbar.title | '{rarity-prefix}&f{mob} &c❤{health}' | The title. It takes the tokens of name-format. |
mobs.bossbar.color | RED | PINK, BLUE, RED, GREEN, YELLOW, PURPLE or WHITE. |
mobs.bossbar.style | SOLID | SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12 or SEGMENTED_20. |
Any other color or style uses the shipped one, with a warning.
Damage hologram
Above the name of each mob you hit, a text only you see shows the total damage you did to it. Swings and enchants both count, rounded to a whole number, in currencies.number-format. Players can hide it with the setting zones.damage-numbers.
- It appears at
initial-scaleandinitial-angle. - Every later hit makes it
scale-per-hitbigger, up tomax-scale, and turns itangle-per-hitdegrees towardmax-angle. - Every hit pulses it: it shrinks by
pulse-shrinkof its size inpulse-color, then grows back,pulse-tickseach way. - It goes with the killing hit, when your fight ends or moves to another mob, and after
linger-tickswithout a hit.
At most 64 pulses leave the server in one tick. Past that, an area enchant that hits many mobs still changes the totals, size and tilt, without a pulse.
| Key | Default | What it does |
|---|---|---|
mobs.damage-hologram.enabled | true | false shows no hologram. |
mobs.damage-hologram.format | '&c{damage}' | The text. {damage} is the total. |
mobs.damage-hologram.offset-y | 0.5 | Blocks between the top of the name and the bottom of the text, -4 to 8. |
mobs.damage-hologram.shadow | true | Whether the text has a shadow. It never has a background. |
mobs.damage-hologram.see-through | true | Shows through the mob and blocks, like a name tag, so you see it from inside the mob. |
mobs.damage-hologram.full-bright | true | Draws it at full light, also in the dark. |
mobs.damage-hologram.initial-scale | 1.0 | The size on the first hit (1 = the size of the name), 0.1 to 8. |
mobs.damage-hologram.max-scale | 8.0 | The size it stops growing at, from initial-scale to 16. |
mobs.damage-hologram.scale-per-hit | 0.2 | The size every later hit adds, 0 to 8. 0 = it never grows. |
mobs.damage-hologram.pulse-shrink | 0.2 | The share it shrinks on a hit (0.2 = to 80% and back), 0 to 0.9. 0 = no pulse. |
mobs.damage-hologram.pulse-ticks | 2 | Ticks to shrink, and the same again to grow back, 1 to 20. |
mobs.damage-hologram.pulse-color | '#FAFAFA' | The text color during a pulse. '' = keep the colors of format. |
mobs.damage-hologram.initial-angle | 0 | The tilt on the first hit, in degrees, -180 to 180. |
mobs.damage-hologram.max-angle | 45 | The tilt it stops at, in degrees, -180 to 180. |
mobs.damage-hologram.angle-per-hit | 1 | Degrees every later hit turns it, 0 to 90. 0 = it never turns. |
mobs.damage-hologram.linger-ticks | 60 | Ticks without a hit before it goes, 0 to 1200. 0 = it stays until the mob dies or the fight ends or moves. |
A hologram you do not see. Turn the debug output on with /dungeons debug. To see only the zone lines, set debug.categories: [zones] in config.yml. Each hologram logs when it spawns, when a hit shows nothing (and why), and when it ends. A spawn with no end while you keep hitting means your client did not draw it. Try a vanilla client, or see-through: false.
Hurt flash
mobs.hurt-flash: true makes a mob flash red on every hit it survives. It is the game's own hurt tint, about half a second per hit, so with fast swings the mob stays red. The shipped false sends none. The death animation is the same either way.
Configuration
The fight keys of mobs:
| Key | Default | What it does |
|---|---|---|
mobs.name-format | '{rarity-prefix}&fLVL{stage} {mob} &c❤{health}' | The name above each mob. See The mob name. |
mobs.respawn-seconds | 3 | Seconds from a death until a new mob appears, 1 to 3600, decimals work. The death animation is the first second. |
mobs.leave-area-distance | 8 | Blocks you may walk out of the area's columns while fighting, measured flat to the nearest edge, 0 to 64. A click from there starts a fight too. 0 = the hits stop at the edge. |
mobs.hurt-flash | false | true = a hit mob flashes red. |
mobs.bossbar.* | See Boss bar. | |
mobs.damage-hologram.* | See Damage hologram. | |
mobs.rarities.<id>.* | five rarities | See Rarities. |
The sword's combat: block
These live in modules/sword/config.yml and are explained on Sword.
| Key | Default | Short meaning |
|---|---|---|
combat.base-damage | 1.0 | Damage of one swing before the tier |
combat.swings-per-second | 2.0 | Swings of every sword before its tier and level |
combat.max-swings-per-second | 20 | The cap, 1 to 20 |
combat.leveling | level | The leveling whose levels add swings |
combat.swings-per-level | 0.01 | Swings added per level gained |
combat.hit-distance | 6 | Farthest you may stand from your target, 1 to 32 |
combat.stop-on-unequip | true | Whether the hits stop when you hold another item |
Tips
- To make bosses feel special, raise their
health-bonusandreward-bonustogether, so a boss pays for its time. - A rarity with
chance: 0stays in the file but never rolls. Use it to switch one off for a while. /dungeons admin inspect player <player>shows the damage and swings the plugin computed for a player.
Default fight keys and rarities of modules/zones/config.yml
mobs:
# Name shown above each mob (color codes allowed). {rarity-prefix} is the
# prefix of its rarity, {stage} the stage number, {mob} the name of the
# stage's mob and {health} the health it has left: the stage's health plus
# the rarity's health-bonus until it is hit, in the currencies.number-format
# of config.yml.
name-format: '{rarity-prefix}&fLVL{stage} {mob} &c❤{health}'
# Seconds from a mob's death until a new mob of the same stage appears at
# another place of the mob area (the same distances apply, the rarity is
# rolled again and the health is full), from 1 to 3600; decimals work. The
# death animation is the first second of it. /dungeons reload applies a
# change.
respawn-seconds: 3
# Blocks a player may walk out of the columns of the mob area while
# fighting (measured flat, to the nearest edge of the area): the swings go
# on while the target stays within the sword's hit-distance (combat: in
# modules/sword/config.yml) and the sword stays in hand, and a click from
# there starts a fight too. 0 = the swings stop at the edge of the area.
# From 0 to 64; decimals work.
leave-area-distance: 8
# true = a mob flashes red on every hit it survives (the vanilla hurt
# tint, about half a second per hit, so with fast swings it stays red
# while it is hit). false = no flash. /dungeons reload applies a change.
hurt-flash: false
# The boss bar of the mob a player is hitting, seen by that player alone:
# it empties with the mob's health (swings and enchants), goes when the mob
# dies or the fight ends, and moves to the new mob when the target changes.
# title takes {rarity-prefix}, {stage}, {mob} and {health} like
# name-format (color codes allowed). color: PINK, BLUE, RED, GREEN, YELLOW,
# PURPLE or WHITE. style: SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12 or
# SEGMENTED_20. Any other value uses the shipped one, with a warning.
bossbar:
enabled: true
title: '{rarity-prefix}&f{mob} &c❤{health}'
color: RED
style: SOLID
# A text above the name of each mob a player hits, seen by that player
# alone: the total damage they did to that mob (swings and enchants),
# rounded to a whole number, in the currencies.number-format of config.yml.
# It goes when the mob dies, when the player's fight ends or moves to
# another mob (the next hit starts a new count), and after linger-ticks
# without a hit. Every hit makes it a little bigger and turns it a little
# more, and pulses it (a quick shrink in pulse-color, then back).
# Needs nms.enabled: true in config.yml, like the mobs.
damage-hologram:
enabled: true
# {damage} is the total (color codes allowed).
format: '&c{damage}'
# Blocks between the top of the name and the bottom of the text (the
# text grows upward from there), from -4 to 8.
offset-y: 0.5
# true = the text has a shadow. It never has a background.
shadow: true
# true = the text shows through the mob and through blocks (like a name
# tag), so it is seen even from inside the mob.
see-through: true
# true = the text is drawn at full light, also in the dark.
full-bright: true
# The size of the text on the first hit (1 = the size of the name), 0.1
# to 8.
initial-scale: 1.0
# The size it stops growing at, from initial-scale to 16.
max-scale: 8.0
# The size every later hit adds, 0 to 8 (0 = it never grows).
scale-per-hit: 0.2
# On every hit the text shrinks by this share of its size and grows back
# (0.2 = to 80% and back), 0 to 0.9 (0 = no pulse).
pulse-shrink: 0.2
# Ticks the text takes to shrink, and the same again to grow back, 1 to
# 20.
pulse-ticks: 2
# The color of the text while it pulses (#RRGGBB); it then goes back to
# the colors of format. '' = keep the colors of format.
pulse-color: '#FAFAFA'
# The tilt of the text on the first hit, in degrees, -180 to 180.
initial-angle: 0
# The tilt it stops turning at, in degrees, -180 to 180.
max-angle: 45
# Degrees every later hit turns it toward max-angle, 0 to 90 (0 = it
# never turns).
angle-per-hit: 1
# Ticks without a hit after which the text goes (a mob hit by an enchant
# that is not the one the player fights), 0 to 1200; 0 = it stays until
# the mob dies or the fight ends or moves to another mob.
linger-ticks: 60
# The rarities a mob can roll. chance is a weight: a rarity is picked with
# probability chance / (sum of every chance). glow is the color of the mob's
# outline (a color name such as AQUA, YELLOW, DARK_PURPLE or its alias
# PURPLE; NONE for no outline), health-bonus the percentage added to the
# stage's health, reward-bonus the percentage added to every reward of the
# stage's mob (100 doubles them) and prefix the {rarity-prefix} of
# name-format. A missing chance is 0 (never rolled, with a warning), a
# missing glow NONE, a missing health-bonus or reward-bonus 0 and a missing
# prefix empty; when no chance is above 0 every mob is plain.
# sn:extensible
rarities:
common:
chance: 70
glow: NONE
health-bonus: 0
reward-bonus: 0
prefix: ''
rare:
chance: 15
glow: AQUA
health-bonus: 100
reward-bonus: 100
prefix: '&b[RARE] '
epic:
chance: 10
glow: PURPLE
health-bonus: 200
reward-bonus: 200
prefix: '&5[EPIC] '
legendary:
chance: 5
glow: YELLOW
health-bonus: 300
reward-bonus: 300
prefix: '&e[LEGENDARY] '
boss:
chance: 1
glow: RED
health-bonus: 600
reward-bonus: 600
prefix: '&r&l[BOSS] '