resourcepack.ai
DOCS

Content

Entities

A custom entity is a real Minecraft mob that wears one of your models: a temple guard, a rhino, a boss. Its AI and pathing are a vanilla mob's, so it fights, wanders and dies like one, but it looks like your model, plays an animation for whatever it is doing, and has the stats, sounds and name you give it.

# entities/mobs.yml
rhino:
  type: POLAR_BEAR        # required. Chosen for behaviour: the looks are replaced
  model: zoo:rhino        # assets/models/rhino.bbmodel, or an item id
  name: "&7Rhino"
  health: 40
  damage: 6
  speed: 1.2
  scale: 1.0
  height: 1.4
  head-bone: head
  tags: [zoo]
  animations:
    spawn: appear
    idle: idle
    walk: walk
    run: gallop
    attack: charge
    hurt: flinch
    death: fall
  sounds:
    ambient: zoo:grunt
    hurt: zoo:ouch
    death: entity.cow.death
  drops:
    - {item: minecraft:leather, min: 1, max: 3}
    - {item: zoo:horn, chance: 0.25}
  xp: 5

To make one:

  1. In your content folder (here zoo), save the Blockbench model as assets/models/rhino.bbmodel.
  2. Write the mob in entities/, as above. model: zoo:rhino names that file (<content folder>:<file>). You don't need an item for it.
  3. Run /rp reload, then /rp spawn zoo:rhino spawns one where you stand. /rp entities lists them all.

model: can also name an item that wears the model, and several mobs can wear one model. If it names neither a model nor an item, the mob spawns as the plain vanilla mob and /rp reload warns about it.

Needs RP Engine 0.2.51 or newer; skills, the options under More options, drop tables and spawners need 0.2.53.

Everything a mob takes#

FieldDefaultWhat it does
typerequiredThe vanilla mob it is underneath. See Choosing the type
modelnoneThe model it wears: a file in assets/models/, or an item id
namenoneIts name, with & colour codes. See Its name
name-visibleshown when namedtrue always shows the name, false only when somebody looks at the mob
healththe mob's ownMax health, 1 to 1024
damagethe mob's ownAttack damage
speed1A multiple of the mob's own speed, 0.1 to 4
knockback-resistancethe mob's own0 to 1
scale1How big the model is drawn, 0.1 to 16. The hitbox is unchanged
heightthe mob's ownHow tall the hitbox is, in blocks (1.20.5 and newer)
turn0Which way the model faces, in degrees. See Facing
head-bonenoneA bone that turns toward whatever the mob is fighting
aitruefalse stands it still for ever
burnsfalsetrue lets daylight set it alight, like a zombie
silentfalseMutes the mob's own sounds
tagsnoneScoreboard tags added when it spawns
animationsnoneOne of the model's animations per state. See Animations
soundsthe mob's ownAmbient, hurt, death, attack and step. See Sounds
drops, xpnothing, 0What it drops. See Drops
hurt-flashtrueFlashes red when damaged
follow-rangethe mob's ownHow far it spots something to chase, 1 to 128 blocks
fire-immunefalseFire, lava, magma blocks and burning do no harm, and it never catches fire
glowingfalseDraws the model with the glowing outline
boss-barnoneA boss bar with its name and health. See Boss bars
rangednoneIt shoots. See A mob that shoots
spawningnoneIt appears on its own. See Spawning on its own
skillsnoneWhat it does besides walk and bite. See Skills

The fields that came over from MythicMobs (armour, equipment, levels, factions, templates and the rest) are under More options.

Choosing the type#

Pick type for how it should behave, not how it should look. A zombie hunts players, a polar bear wanders and fights back, an iron golem guards, a pig wanders and runs when hit, an allay drifts, a phantom swoops, an armour stand does nothing at all. It must be a mob that can be spawned.

It is genuinely that mob: every other plugin sees it as one, and tags are how the rest of your server finds yours: @e[tag=zoo] in a command block, a condition in another plugin, or a /kill that clears one kind and not another.

A custom mob is never bred, tamed, ridden, sheared, milked or traded with, never spawns as a baby or with a jockey, and never turns into something else (a drowned zombie, a struck pig). A name tag and a lead still work on it, unless prevent: says otherwise.

How the model is worn#

The mob's own body is made invisible, not removed, so players hit it where the model appears to be.

The model stands on the ground the mob stands on: its bottom (pixel 0 in Blockbench) is at the mob's feet, whatever the type and size. scale: sizes only the model. height: sizes the hitbox, and its width grows with it; that needs 1.20.5 or newer, and older servers keep the mob's own box.

A custom mob you spawn never despawns, unless you say so with despawn:. One that spawned on its own despawns like the mob it replaced. Whenever a mob wearing a model goes without dying (despawned, removed on peaceful, removed by another plugin), its model goes within a tick or two.

Facing#

At turn: 0 the side Blockbench calls North (-Z) is the front, as in ModelEngine, so a model made for ModelEngine walks forwards unchanged.

The model was built facingturn
North (-Z)0
East (+X)90
South (+Z)180
West (-X)270

Mobs made in Studio are turned for you. /rp bind and MythicMobs' rpmodel have no turn:, so a model you put on somebody else's mob should be drawn facing North.

The head#

head-bone: names a bone that turns toward whatever the mob is targeting, as an h_ bone does. The bone has to move in at least one animation: a bone that never moves is drawn as part of the still body and has nothing of its own to turn.

A model's other bones work too: b_ bones are hitboxes of their own, p_ bones are seats, and tag_name is where the name floats. See Bones that do something.

Hurt flash#

When it takes damage the model goes red for about a third of a second, as a vanilla mob does (a red outline instead for a still model, or on servers older than 1.21.4). hurt-flash: false turns it off.

Animations#

animations: maps each state to one of the model's animations, by name. The states, most important first:

StateWhenPlays
deathIt dies. The model stays for the animation (at most five seconds), then goesonce
spawnIt was just spawnedonce
attackIt hits something, or fires at itonce
hurtIt takes damageonce
runIt moves fast, or chases what it is fightingloop
walkIt movesloop
idleIt standsloop

When several apply, the one higher in the list plays. A once animation plays to its end and the mob goes back to what it was doing; only a more important one cuts it short, so a mob hit mid-bite keeps biting, and a mob killed mid-bite falls over.

A blank loop falls through: with no run it walks, with no walk it idles, with no idle it stands in its rest pose. A blank once-animation simply doesn't play, and neither does a state naming an animation the model doesn't have.

Animations can also be played from a skill (animate), and a skill can change which animation a state plays from then on (defaultstate), for a boss that limps once it is badly hurt.

Sounds#

  sounds:
    ambient: zoo:grunt      # every 8 to 20 seconds while somebody is near
    hurt: zoo:ouch
    death: entity.cow.death # a vanilla sound event works too
    attack: zoo:snort
    step: zoo:thud

Each is a sound from a pack (zoo:grunt) or a vanilla sound event. Setting any of them silences the mob's own sounds, so a rhino built on a polar bear does not growl like one.

Its name#

The name floats just above the model, not over the hidden body: at the model's top, or at its tag_name bone if it has one, whatever the type and scale:.

name-visible: true shows it always. false shows it only to a player whose crosshair is on the mob, within reach and not through a block, as vanilla does for a named mob. Unlike a vanilla name it is not drawn through walls, so it never vanishes inside the model. & colours and <fx:...> Text Effects work in it.

A name can carry live values, kept current until a name tag renames the mob:

In name:Shows
{hp}Its health now
{max_hp}Its max health
{hp%}Its health as a percentage
{stance}Its stance
{level}Its level
name: "&6Golem King &7{hp}/{max_hp}"

A name tag, /data or a plugin renaming the mob changes it within half a second, and the name goes the moment the mob dies.

Boss bars#

golem:
  type: RAVAGER
  model: mypack:golem
  name: "&2Moss Golem"
  boss-bar: {color: GREEN, style: SEGMENTED_10, range: 40}

A boss bar with the mob's name (its name tag's, else its id) and health, shown to every player within range blocks.

KeyDefaultWhat it is
colorPURPLEPINK, BLUE, RED, GREEN, YELLOW, PURPLE or WHITE
styleSOLIDSOLID, SEGMENTED_6, SEGMENTED_10, SEGMENTED_12 or SEGMENTED_20
range32Blocks, 1 to 256
fogfalseThickens the fog for the players who see it
darken-skyfalseDarkens their sky
musicfalsePlays the boss music

boss-bar: true is all the defaults. A skill can also put up bars of its own with barcreate, for a boss with a shield bar beside its health.

A mob that shoots#

archer:
  type: SKELETON
  model: mypack:mushroom
  ranged:
    projectile: snowball   # arrow, snowball, small_fireball, fireball, wither_skull, trident
    damage: 3              # per hit; 0 keeps the projectile's own
    range: 18              # blocks, 2 to 64
    cooldown: 2            # seconds between shots, 0.25 to 60, when RP Engine shoots

ranged: snowball is shorthand for the projectile alone, with the rest at their defaults (arrow, the projectile's own damage, 16 blocks, 2 seconds).

A skeleton, stray or bogged (on 1.21.4 and newer) shoots with its own AI: it keeps its distance, strafes and aims like a skeleton, at the skeleton's own pace, so cooldown is not used. Any other type shoots every cooldown seconds while its target is in range and in sight.

Either way its attack animation and sound play as each shot leaves, not when it lands. A fireball or a wither skull explodes without breaking blocks, and nobody can pick up a custom mob's arrows.

Spawning on its own#

desert_ghoul:
  type: HUSK
  model: mypack:ghoul
  spawning:
    worlds: [world]
    biomes: [desert, "*badlands*"]
    replaces: [HUSK, ZOMBIE]
    chance: 0.1
    time: night
    min-light: 0
    max-light: 7
    min-group: 1
    max-group: 2
    max-per-chunk: 2
KeyDefaultWhat it does
worldsevery worldThe worlds it spawns in
biomesevery biomeBiome names (minecraft: optional), with * matching anything: *forest*
replacesits own kindThe vanilla mobs it stands in for
chance0.1The share of matching natural spawns it takes, 0 to 1
timeanyday, night or any
min-light, max-light0, 15The light level where it appears
min-group, max-group1, min-groupHow many appear together, up to 16
max-per-chunk2No more extra group members once a chunk holds this many, up to 64

It takes the place of natural spawns rather than adding to them: when a matching vanilla mob spawns, yours replaces it (with up to max-group - 1 more beside it). So the server's mob caps, difficulty and spawn rules still apply, and peaceful spawns nothing.

Without replaces: it can stand in for any natural spawn of its own kind: a hostile type for monsters, an animal for animals, a water creature for water creatures. An iron golem, an allay or a villager needs replaces:, because nothing spawns naturally as one. Biome tags (#is_forest) are not read, and warn at load. Night is game time 12300 to 23850.

A mob that spawned on its own despawns when nobody is near, as the mob it replaced would have.

More options#

These are MythicMobs' mob options, under RP Engine's names. If you are bringing mobs across from MythicMobs, Porting your MythicMobs mobs has the whole mapping.

knight:
  extends: brute                 # everything brute says, then this
  type: ZOMBIE
  armor: 12                      # armour points, 0 to 30
  armor-toughness: 4             # 0 to 20
  equipment:                     # worn for real: armour counts, a weapon hits harder
    head: minecraft:iron_helmet
    hand: {item: zoo:axe, drop-chance: 0.1}
  damage-modifiers: {FIRE: 0, PROJECTILE: 0.5, MELEE: 1.5}
  invincible: false              # true: takes nothing but the void and /kill
  collidable: true               # false: players and mobs walk through it
  gravity: true
  despawn: never                 # never, natural or chunk
  faction: undead                # never targets another mob of its faction
  level: 1to5                    # rolled per mob; or a number
  per-level: {health: 10, damage: 1, armor: 0.5, speed: 0.02, power: 0.25}
  prevent: [leash, rename]       # name tags and leads stop working on it
  kill-messages: ["{player} met the knight"]
  mount: zoo:warhorse            # rides this, spawned under it
FieldDefaultWhat it does
extendsnoneBuilds this mob on another. See Templates
armorthe mob's ownArmour points, 0 to 30
armor-toughnessthe mob's own0 to 20
equipmentnoneWhat it wears and holds. See Equipment
damage-modifiersnoneMultiplies each kind of damage it takes. 0 makes it immune
invinciblefalseTakes no damage but the void and /kill
collidabletruefalse lets players and mobs walk through it
gravitytruefalse and it floats where it is
despawnnevernever, natural (when no player is near) or chunk (gone when its chunk unloads, never saved)
factionnoneIt never targets another custom mob of the same faction
level, per-level1See Levels
preventnoneleash and rename stop leads and name tags working on it
kill-messagesnoneThe death message of a player it kills, one at random. {player} and {mob} are filled in
mountnoneA custom mob id or a vanilla type, spawned under it for it to ride
threat-tablefalseIt fights whoever has hurt it most. See Threat tables
stancenoneThe stance it starts in
variablesnoneThe variables it starts with: {phase: 1}

despawn: natural is the default for a mob that spawned on its own; never is the default for everything else (a command, an egg, a spawner or a plugin).

Templates#

extends: builds a mob on another one, as MythicMobs' Template: does (template: reads the same):

  • a key the mob writes itself wins;
  • a map (sounds:, animations:, boss-bar:) is merged key by key;
  • a list is replaced, except skills:, which is the template's lines followed by the mob's own.

A template marked abstract: true needs no type: and is never a mob itself, so a shared base doesn't show up in /rp entities. Templates can extend templates; a loop is a load warning.

undead_base:
  abstract: true
  burns: true
  faction: undead
  sounds: {hurt: zoo:rattle}
  skills:
  - potion{type=WITHER;duration=60} @trigger ~onAttack 0.2
 
skeleton_knight:
  extends: undead_base
  type: SKELETON
  model: zoo:skeleton_knight
  health: 60

Equipment#

equipment: takes head, chest, legs, feet, hand and offhand, each a pack's item or a vanilla one, with an optional drop-chance (default 0, rolled on top of drops:). MythicMobs' list form (- iron_helmet HEAD) and its slot numbers work too.

A mob wearing a model shows none of it, since the model is what is seen. On 1.21.4 and newer each piece is worn but drawn as nothing, so its armour and damage still count. Older servers cannot hide a worn item, so there a modelled mob wears nothing (armor: still works). A mob with no model wears its equipment as any mob does.

Damage modifiers#

damage-modifiers: multiplies each kind of damage the mob takes, by Bukkit's cause names (FIRE, FIRE_TICK, LAVA, PROJECTILE, ENTITY_ATTACK, FALL, BLOCK_EXPLOSION and the rest) or MythicMobs' groups MELEE, EXPLOSION and BURNING. 0 makes it immune to that cause: the hit is cancelled, so it doesn't even flinch. The list form - FIRE 0 works too.

Levels#

level: is rolled for each mob as it spawns, a number or a range (1to5), unless /rp spawn, a spawner or a skill's summon{level=3} says which. Each level above the first adds per-level:'s amounts:

per-level keyAdds to
healthMax health
damageAttack damage
armorArmour points
speedThe speed: multiplier
powerThe multiplier its skills' amounts take: power: 0.25 makes a level 3 mob's skills hit 1.5 times as hard

The level shows in its name as {level}, in a skill as <caster.level>, and the level{l=3to5} condition tests it.

Spawning one#

CommandWhat it does
/rp spawn <id>Spawns one where you stand
/rp spawn <id> <x> <y> <z> [world] [count] [level]Spawns up to 64 at a place, at a level. The world may also come first. This is how the console spawns one
/rp egg <id> [player] [amount]A spawn egg that hatches that mob where it is used
/rp spawner create <name> <mob>A spawner that keeps some alive round where you stand. See Spawners
/rp entitiesEvery custom mob

An egg used on a vanilla spawner hatches the mob there and leaves the spawner alone. Mobs made in Studio arrive when you push or publish the pack, and are spawned as studio:<id>, exactly like the ones in your content folder.

From your own plugin, engine.mobs().spawn(...); see the Plugin API.

On Bedrock#

Bedrock players joining through Geyser see a custom mob as its model too, sized by scale:, turned by turn:, playing the same animations and flashing red when hit. A dying mob tips over the way a Bedrock mob does rather than playing death, and its name sits over the hitbox. See Bedrock and Geyser.

Somebody else's mob

To put a model on a mob another plugin spawned, like a MythicMobs boss or a Citizens NPC, see Putting a model on a mob. That page dresses an existing mob; this one creates a new one.