Mob Areas
On this page(12)
A mob area is a box of blocks in a zone file. Inside it, each player sees the mob of the stage they are at, spread over the ground. The mobs exist only for that player: they are sent to their client alone, and the server has no such entity.
| Files | mob-area: of modules/zones/zones/<zone>.yml; mobs.facing and mobs.wand of modules/zones/config.yml |
| Admin commands | /dungeons admin zones wand, setarea <zone>, respawn [zone] |
| Needs | The packet layer (nms.enabled: true in config.yml). With it off, no mob shows. |
How it works
- What you see. With
max-mobs: 20a player sees 20 of their stage's mob. They stand still at random places, spread evenly over the ground of the box, all facing the side ofmobs.facing. - Only for you. Nobody else sees your mobs, whatever
/zone visibilitysays. They never hit back, and you kill them with your sword (see Fighting and Rarities). - Which stage. You see the mobs of the stage you are at, anywhere in the world of its zone's mob area. See Zones.
- A stage change. The old mobs disappear and the new stage's appear. From that moment the old mobs can no longer be hit or picked by an enchant, so they never pay.
- Leaving. Leaving that world, quitting or switching the module off removes them. They come back when they apply again: after a join, you get the mobs of the stage you were at.
A zone without a mob-area shows no mobs, and so does a stage without a mob:. A zone file that could not be read at startup shows its players no mobs at all.
Marking the area
- Run
/dungeons admin zones wandto get the wand. - Left click a block for the first corner, and right click a block for the second. The edges of the box show with particles.
- Run
/dungeons admin zones setarea <zone>. It writesmob-areainto the zone file and shows the mobs to the players of that zone. The wand marks disappear, and your next click starts a new box.
setarea writes the world and the two corners. It also writes max-mobs, min-border-distance and min-mob-distance with their defaults when the file has none. Edit those by hand afterwards and run /dungeons reload.
Include the floor. Each mob stands on the highest solid block of its column. Its feet must be inside the box, with two free blocks above the floor. Click one corner ON the floor and the other at least one block higher. setarea warns you about a box one block tall, where no mob fits.
Refused boxes. A box bigger than mobs.wand.max-volume (250000 blocks as shipped) is refused, and nothing is written. So is one whose columns span more than 4096 chunks. A zone file takes at most 1000000 blocks. The marks stay, so you can mark a corner again.
The world. Mark the area in the world of the zone spawn: the mobs show only in the world of the area. Both corners must be marked in the same world.
Using the wand needs the permission sndungeons.admin.zones.wand. The wand keeps working while the zones module is off. There is no setarea to save the box until the module is back.
In an isolated world, the wand particles near another isolated player may not reach you (see Isolated Zone Worlds). Mark the area with nobody near.
The mob-area keys
mob-area:
world: dungeons
min: '10,64,10'
max: '60,70,60'
max-mobs: 20
min-border-distance: 2
min-mob-distance: 3| Key | Default | What it does |
|---|---|---|
world | required | The world of the area. A world that is not loaded shows no mobs. |
min, max | required | The two corners, x,y,z, in any order. |
max-mobs | 20 | How many mobs each player sees, 0 to 200. Fewer show when no more fit the distances. |
min-border-distance | 2 | Blocks kept free between a mob's column and the edge of the box, 0 or more. |
min-mob-distance | 3 | The least horizontal distance between two mobs, in blocks, 0 or more. |
Edit max-mobs and the two distances in the zone file and run /dungeons reload. Every player of that zone gets their mobs again with the new values.
A mob-area that cannot be read is reported in the console, and the zone shows no mobs while the rest keeps working. That covers a missing world and a corner that is not x,y,z or lies outside the world. It also covers a box over 1000000 blocks or 4096 chunks. An area where no mob fits is reported too.
Placement and facing
Spread. Each mob goes to the spot, out of 16 drawn at random, farthest from the mobs already placed. It also keeps at least min-mob-distance from each of them. When none of the 16 keeps that distance, the first spot that does is taken. So the mobs do not bunch up next to large empty patches, and a tight box still fills.
Ground. A mob stands on a solid block with room for its body. It never stands in water, lava, water plants, powder snow or cobwebs.
Facing. mobs.facing is the side every mob of every zone looks at, body and head. It is NORTH, SOUTH, EAST or WEST, in any case. RANDOM turns each mob its own way. A missing key reads SOUTH, and so does any other value, with a warning. /dungeons reload applies a change.
The ground and respawn
The ground of an area is read once per zone and kept. For a big area the read is spread over several ticks. Chunks that are not loaded are loaded in the background the first time, never generated.
/dungeons reload keeps the ground it read, so it does not see a terrain edit inside an area. After editing the terrain, run /dungeons admin zones respawn <zone>, or respawn alone for every zone. It reads the ground again and shows the players of that zone new mobs. setarea reads the ground of its zone again too.
Configuration
mobs.facing
| Key | Default | What it does |
|---|---|---|
mobs.facing | SOUTH | The side every mob looks at: NORTH, SOUTH, EAST, WEST or RANDOM. |
mobs.wand
| Key | Default | What it does |
|---|---|---|
mobs.wand.item.material | BLAZE_ROD | The wand item. |
mobs.wand.item.display-name | '&6&lZone Mob Area Wand' | Its name. |
mobs.wand.item.lore | three lines | Its lore. |
mobs.wand.item.glow | true | Whether it glows. |
mobs.wand.particle.type | DUST | The particle of the box edges. Any particle name. |
mobs.wand.particle.color | '255, 140, 0' | The DUST color: 'R, G, B' or '#RRGGBB'. |
mobs.wand.particle.size | 1.2 | The DUST size, 0.1 to 4.0. |
mobs.wand.step | 0.5 | Blocks between two edge particles, 0.1 or more. |
mobs.wand.interval-ticks | 5 | Ticks between two redraws of the edges. |
mobs.wand.max-volume | 250000 | The largest box, in blocks, the wand accepts. 0 = no wand limit (setarea still stops at 1000000). |
Limits
- The mobs are fake. They drop no items (a kill pays the stage's
rewards), have no AI, never move and never hit back. Nothing on the server collides with them. - Outline colors. The rarity outlines use scoreboard teams named
sndg_glow_<color>that exist only in each player's client. Other plugins' teams are not touched. A team color also tints any uncolored part of a glowing mob's name. So startmobs.name-formatwith a color code.
Commands
| Command | Permission | Description |
|---|---|---|
/dungeons admin zones wand | sndungeons.admin.zones.wand | Gives you the wand that marks the mob area of a zone. The node also allows using the wand. |
/dungeons admin zones setarea <zone> | sndungeons.admin.zones.setarea | Writes the box you marked with the wand as the zone's mob area. |
/dungeons admin zones respawn [zone] | sndungeons.admin.zones.respawn | Reads the ground again and respawns the mobs. |
Tips
- Start with a modest
max-mobsand raise it while you watch. Each mob is sent to its player as packets. - A flat, open floor with a clear ceiling two blocks up fits the most mobs.
- Mobs missing after you rebuilt the floor? Run
/dungeons admin zones respawn <zone>.
Default mobs.facing and mobs.wand of modules/zones/config.yml
mobs:
# The side every mob of every zone looks at (body and head): NORTH, SOUTH,
# EAST or WEST; RANDOM turns each mob its own way. Any other value is SOUTH,
# with a warning. /dungeons reload applies a change.
facing: SOUTH
# The selection wand of /dungeons admin zones wand: left click a block for
# the first corner and right click a block for the second; the edges of the
# box show with particles while you select. Then run
# /dungeons admin zones setarea <zone>; the marks disappear once setarea
# writes the area. Using it needs the permission sndungeons.admin.zones.wand.
wand:
# The wand item (display-name, material, lore, glow, ...).
item:
material: BLAZE_ROD
display-name: '&6&lZone Mob Area Wand'
lore:
- '&7Left click a block: &ffirst corner'
- '&7Right click a block: &fsecond corner'
- '&7Then: &f/dungeons admin zones setarea <zone>'
glow: true
# The particles of the box edges.
particle:
# Any particle name; DUST takes the color and size below.
type: DUST
# DUST color: 'R, G, B' or '#RRGGBB'.
color: '255, 140, 0'
# DUST size, from 0.1 to 4.0.
size: 1.2
# Blocks between two edge particles (0.1 or more).
step: 0.5
# Ticks between two redraws of the edges.
interval-ticks: 5
# Largest box, in blocks, the wand accepts; setarea refuses a bigger one.
# 0 = no limit of the wand (setarea still stops at 1000000 blocks, the most
# a zone file takes).
max-volume: 250000