wiki:olivine/dsl/attribs/mobs

Version 2 (modified by jonathan, 4 years ago) (diff)

Add a couple examples

Mob Definition Attributes

Visit core types for information on primitive and core types such as text, integer, or list.

Name Type Description
nametextGive the mob a custom name here, this is what floats over its head
healthintegerThe amount of life (in hearts) the mob should have
shieldintegerThe amount of absorption, as with what enchanted golden apples provide, (in yellow hearts) the mob should have
modifiersmob modifiersA set of modifiers that apply to the mob, click on mob modifiers for more information
effectslist of effectThis is a list of potion effect(s) that will be run on the mob when it is spawned, click on effect' for more information on how to define a single effect
equipmentmob equipmentDefinition of equipment that the mob should have, click on mob equipment for more information
dropslist of weighted item bundleA list of item bundles that the mob potentially drops with optional weighted chances (percentages), click on weighted, item, and/or bundle to learn more about each
orientationcoordinatesThe normal vector that determines which way the mob should be facing when it spawns (e.g. < 1, 0, 0 > faces east, < -1, 0, 0 > faces west, < 0, 0, 1 > faces south)
levelintegerAn RPG-style level for the mob that determines how much experience it yields when a player kills it. The amount of XP is taken from this number and multiplied by 5. This is the absolute amount of experience, not experience levels (e.g. /xp @p 42 vs /xp @p 42L)
flagsset of mob flagsAdditional features to apply to this mob when it is spawned, click on mob flags for more information
agemob ageWhether the mob is a child or an adult, set to one of those values
fenceboxDetermines an area that the mob is not allowed to exceed, if the mob paths outside of this area (or spawns initially outside of it) then they will automatically walk / path back inside of it
ridingmob attributesDefines another mob that this mob will spawn riding on-top of, the definition for this is the same as this definition, it's nested.
olivinetextThe name of another Olivine program to run on this mob when it spawns. The program must already be uploaded to the Olivine Script Manager

mob modifiers

All these are modifier definitions, click on the link for information on how to define one.

  • health - 'nuff said
  • stability - knockback resistance
  • agility - movement speed
  • strength - attack damage dealt
  • jumping - how high the mob can jump
  • propagate - how likely a mob is to spawn reinforcements to help it, presently this only applies to zombies
  • owly - how far away a mob can path-find to or track targets from (hence the name 'owly' because owls are masters at this, they can spot a white mouse crawling out of snowy field from their castles in the sky! [hey now, trees are castles too, just a special kind])

mob equipment

All of these are weighted item definitions, click on either link for information about each.

  • hand - what the mob is holding
  • helmet - 'nuff said
  • chest - chestplate
  • leggings - 'nuff said
  • boots - 'nuff said, isn't this language easy?

mob flags

  • permanent - does not despawn automatically
  • immobile - does not move around
  • invulnerable - cannot be harmed
  • benign - does not attack

Mob Attribute Examples

Simple

A very simple example, spawns a mob with a name of "Silly Pants", health of 40 hearts, equipped with a diamond sword and golden helmet:

{
    name → "Silly Pants"
    health → 40

    equipment →	{
        hand → item &minecraft:diamond_sword
        helmet → item &golden_helmet
    }
}

Comprehensive

A very comprehensive example demonstrating almost all possible attributes:

  • Health of 40 hearts
  • Level 30 XP yield
  • Runs an Olivine script named "Some other Olivine Script"
  • Can see up to 30 blocks away
  • Equipped with a bow and armor, all the armor has projectile protection and unbreaking enchantments:
    • Bow enchanted with punch and unbreaking
    • Golden helmet
    • Chainmail chestplate
    • Chainmail leggings
    • Iron boots enchanted also with feather falling
  • Potion effects of speed and regeneration
  • Facing northward
  • Does not despawn automatically
  • 73% chance to drop 2 golden coins, otherwise 27% chance to drop 6 redstone
  • Riding a skeleton horse with:
    • A saddle
    • Iron horse armor
    • Health of 140 hearts
    • And movement speed base of 0.4
{
    health → 40
    level → 30

    olivine → "Some other Olivine Script"

    modifiers → {
        owly → { base → 30 }
    }

    equipment →	{
        hand → item &bow with {
            enchantments → [
                { type → punch; level → 1 }
                { type → unbreaking; level → 3 }
            ]
        }
        helmet → item &golden_helmet with {
            enchantments → [
                { type → projectile_protection; level → 4 }
                { type → unbreaking; level → 3 }
            ]
        }
        chest → item &chainmail_chestplate with {
            enchantments → [
                { type → projectile_protection; level → 4 }
                { type → unbreaking; level → 3 }
            ]
        }
        leggings → item &chainmail_leggings with {
            enchantments → [
                { type → projectile_protection; level → 4 }
                { type → unbreaking; level → 3 }
            ]
        }
        boots → item &iron_boots with {
            enchantments → [
                { type → feather_falling; level → chance of 2 .. 4 } @ 70%
                { type → projectile_protection; level → 4 }
                { type → unbreaking; level → 3 }
            ]
        }
    }

    effects → [
        { type → speed; amplifier → 1; duration → 5 minutes }
        { type → regeneration; amplifier → 2; duration → 3 minutes + 30 seconds }
    ]

    orientation → < NORTH >

    flags → [ permanent ]

    drops → [
        bundle 2 of item &mmm:gold_coin
        bundle 6 of item &redstone @ 27%
    ]

    riding → mob &Horse with {
        saddle → item &saddle
        armor → item &iron_horse_armor
        type → skeleton
        health → 140


        modifiers → {
            agility → { base → 0.4 }
        }
    }
}