-
Notifications
You must be signed in to change notification settings - Fork 1
Mobs
A mob file can hold one mob (fields at the file root, ID = file name) or many mobs (every top-level key is a mob ID):
# mobs/skeleton_knight.yml -> mob "skeleton_knight"
Type: SKELETON
Display: '&c&lSkeleton Knight'
Health: 60# mobs/horses.yml -> mobs "red_horse" and "blue_horse"
red_horse:
Type: HORSE
Health: 30
blue_horse:
Type: HORSE
Health: 30A file with exactly one top-level key and no Type at the root is unwrapped
automatically, so a MythicMobs-style my_mob: block pasted into its own file works.
| Field | Default | Description |
|---|---|---|
Type |
ZOMBIE |
Vanilla entity type (any EntityType, case-insensitive) |
Display |
&f<id> |
Name, & color codes |
Model |
mob ID | BetterModel model attached automatically, see below |
Health |
20 | Max health |
Damage |
2 | Attack damage |
RemoveAi |
false | Disable the AI completely |
Faction |
none | Mobs with the same faction never target or damage each other (also through projectiles and skills). Names are case-insensitive. Players can join a faction too, see below |
AIGoalSelectors |
- | Movement/look/jump goals, see below |
AITargetSelectors |
- | Targeting goals, see below |
Options |
- | See the table below |
Modules.ThreatTable |
false | Re-target whoever dealt the most damage, every second |
Modules.BossBar |
- | A boss bar with the mob's health for nearby players, see Boss bar. BossBar: true uses the defaults |
DamageModifiers |
- | List like - FIRE 1.2, multiplies damage of that cause |
Skills |
- | Skill lines with triggers, see Skills |
Equipment |
- | List of <item>:<slot> lines, for example - BOW:HAND and - my_helmet:HEAD. The item is a registered item id or a vanilla material, the slot is HAND (default), OFFHAND, HEAD, CHEST, LEGS or FEET. Applied on spawn and on reload; dropping chance is 0. Unknown items and slots are logged with the mob id |
Spawn |
- | Turns the mob into a natural spawn, see Natural spawns |
Drops |
- | Drop table names and/or drop lines, see Drop tables |
Unknown fields are ignored.
| Option | Default | Description |
|---|---|---|
Collidable |
true | Entity collision |
MovementSpeed |
vanilla | Movement speed attribute |
KnockbackResistance |
vanilla | Knockback resistance attribute |
Silent |
false | No sounds |
Invincible |
false | Invulnerable |
PreventOtherDrops |
false | Clear the vanilla drops and experience on death. Happens automatically when the mob has Drops:
|
PreventRenaming |
false | Name tags don't work |
PreventLeashing |
false | Can't be leashed |
AlwaysShowName |
false | Show the name tag permanently |
PreventSunburn |
true | Zombies and skeletons don't burn in daylight |
Invisible |
false | Hide the body, equipment stays visible |
CanMove |
true |
false = no AI and no gravity, the mob floats in place |
Interactable |
true |
false = right clicks and equipment swaps are cancelled |
Marker |
false | Armor stands only: no hitbox |
ItemHead |
- | ID of a registered item worn on the head |
FollowRange |
vanilla | How far the mob notices targets |
Scale |
vanilla | Body size, 0.5 = half size |
PreventItemPickup |
false | The mob doesn't pick up items from the ground |
Modules:
BossBar:
Title: '&c<mob.name> &7<mob.hp>/<mob.maxhp>'
Range: 64
Color: RED
Style: SOLIDThe bar is shown to every player within Range blocks of the mob (same world) and updates twice a second.
| Option | Default | Description |
|---|---|---|
Title |
<mob.name> |
Text of the bar. & colour codes, <mob.name> (the Display), <mob.id>, <mob.hp> and <mob.maxhp> (rounded up) and PlaceholderAPI placeholders without a player |
Range |
64 | Blocks around the mob in which players see the bar |
Color |
RED |
PINK, BLUE, RED, GREEN, YELLOW, PURPLE or WHITE
|
Style |
SOLID |
SOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12 or SEGMENTED_20
|
CreateFog, DarkenSky, PlayMusic
|
false | Boss bar effects of the client |
The bar is removed when the mob dies, despawns or its chunk unloads, rebuilt from the new definition on /bettermob reload and removed when the plugin is disabled. An unknown Color or Style logs a warning and uses the default.
Paper can only reuse goals the mob already has, it can't invent new ones. clear removes
the whole category, every other entry re-adds a matching vanilla goal:
AIGoalSelectors:
- clear
- randomstroll # matches e.g. water_avoiding_random_stroll
AITargetSelectors:
- clearNames are matched loosely (case, _ and - are ignored, partial names match). Parameters
in braces, like meleeattack{attackReach=2}, are ignored. An entry the mob doesn't have is
logged and skipped.
MythicMobs names that differ from Paper's are translated:
| You write | Paper goal |
|---|---|
meleeattack |
melee_attack |
attacker |
hurt_by (fight back against whoever hit it) |
players / nearestplayer
|
nearest_attackable |
lookatplayers |
look_at_player |
fleeplayers |
avoid_entity |
Entries may start with a priority number (lower = more important), as MythicMobs packs write them:
1 monsters, 2 attacker. Without a number the entries get 0, 1, 2 ... in order.
Two goals don't exist in Vanilla, BetterMob provides them itself:
| Goal | Behaviour |
|---|---|
lookAtTarget{r=15} |
Faces the target while it is within r blocks |
monsters |
Targets the nearest hostile monster. Mobs managed by BetterMob count as friends (there are no factions), so two of your own mobs never fight each other |
rangedAttack is ranged_bow_attack (or the crossbow one), player is nearest_attackable.
A mob that should fight back needs both a melee goal and a target goal after clear:
AIGoalSelectors:
- clear
- meleeattack
- randomstroll
AITargetSelectors:
- clear
- attackerBetterMob attaches a model in three ways:
-
Automatically through
Model:(default: the mob ID). BetterModel is asked first; if it has no model with that name, ModelEngine is asked. If neither has it, nothing happens and nothing is logged. -
Through a skill:
model{mid=...} @self ~onSpawnfor BetterModel ormodelengine{mid=...} @self ~onSpawnfor ModelEngine (and~onLoad). If a mob has such a skill, the automatic way is skipped, otherwise the two would fight each other.
The vanilla body is hidden automatically once a model is attached. state, mountmodel, @ModelPart and bodyrotation work with both engines, see Skills.
Floating, hands-off displays (for example a card hovering in front of a player):
my_display:
Type: ARMOR_STAND
Display: '&7Label'
Options:
Invisible: true
CanMove: false
Interactable: false
Marker: true
Invincible: true
AlwaysShowName: true
ItemHead: my_item
Skills:
- remove{delay=60} @self ~onSpawnTriggers work for every living entity, armor stands included.
A Spawn block makes the mob replace vanilla spawns:
Type: SKELETON
Spawn:
Worlds: [world] # optional, empty = every world
Biomes: [desert, plains] # optional, empty = every biome
Time: night # day | night | any (default)
Chance: 0.3 # 0-1, rolled per natural spawn, default 1Whenever the server spawns a vanilla mob of the same Type naturally (not from spawners, eggs or commands) and the world, biome, time of day and Chance all fit, that spawn is replaced by this mob. Worlds and Biomes take lists (biome ids with or without minecraft:).
- Without a
Spawnblock nothing is replaced. - If several mobs match, the first one that passes its chance wins.
- A
WorldsorBiomesthat is not a list, aChancethat is not a number or an unknownTimelogs a warning and the wholeSpawnblock is ignored, so a typo never widens the spawn.
For spawns you place yourself see Spawners.
A player belongs to a faction when they have the permission bettermob.faction.<name> (name in lower case) or are listed under factions: in config.yml, by name or UUID:
factions:
elite:
- PlayerName
- 123e4567-e89b-12d3-a456-426614174000Mobs of that faction then never target that player, and the player can't hurt them. Without the permission or an entry a player is in no faction, operators included. Two players are never "the same faction" to each other, only mobs trigger the rule.