Skip to content

Configuration Reference

Erich Gubler edited this page Dec 24, 2011 · 75 revisions

TABLE OF CONTENTS:

  • Before You Read

  • The ModDamage Elements Tree

  • Section A: Events reference - "What Damage-related Events Can I Change With ModDamage?"

  • Section B: Routines - "How do I tinker with these damage events?"

    • [B.01]: Base calculation strings

    • [B.02]: Conditional calculation strings

    • [B.03]: Effect calculation strings

    • [B.04]: Routines: Exhaustively Listed Here

  • Section C: Miscellaneous Config and FAQs (Coming soon!)

Before You Read

For any MD config, you can verify that your YAML is valid here. This is helpful for people new to YAML, and a must for bug reporting.

Some of the syntax notation in individual routine entries may not necessarily be intuitive - it is necessary, then, to clarify what this notation means. An exhaustive list is as follows:

  • $armorsetalias - a valid armor/equipment set interpreted by ModDamage, or an alias comprised of armorsets. See the second tutorial for more information.

  • $biomealias - a valid Biome according to the Bukkit enum, or an alias comprised of these.

  • $comparison - a comparison operator for the comparison conditional. Possible values can be found at the appropriate area in the ModDamage source.

  • $conditionalalias - a Conditional string, which is of the form $condition [$operator $condition]...

  • $elementalias - a string that corresponds to a type of entity in ModDamage. See the ModDamage Elements tree for more information.

  • $environment - a valid Environment according to the Bukkit enum.

  • $groupalias - a group defined in a Permissions implementation supported by ModDamage, or a group alias comprised of these. These are NOT validated by ModDamage upon load, so exercise caution with these values.

  • $itemalias - Basically a Material with an amount associated. The format is $material#somenumber* (no material aliases). It's worth noting that you can use dynamic numbers here.

  • $materialalias - a valid Material according to the Bukkit enum.

  • $logical - a logical operator for a conditional. Located in source here.

  • $messagealias - a valid Message alias reference, a nested set of messages, or single message string. If using the latter, it's recommended to use double-quotes instead of single quotes around your Message routine to ensure that your message is read properly. Some examples:

Damage:
    - 'if (attacker.type.player and attacker.haspermission.customperms.mobcrits) and target.type.mob and chance.10':
        - 'mult.2'
        - 'message.attacker.You have dealt a crit!'
Spawn:
    - 'if target.type.player':
        - 'message.target':
            - '&9MOTD'
            - '&9----------'
            - "&2Protip:&9 don't suck."
            - "&9One man's trash is another man's treasure."
  • $worldalias - a world name in your Bukkit server, or an alias comprised of these. World names are validated upon loading, and will generate a warning that cannot be muted if you attempt to use a world name that does not exist.

The ModDamage Elements Tree

  • Living

    • Animal - Animals are all creatures that serve to benefit the player by either slaughter or taming.

      • Chicken

      • Cow

      • Pig

      • Sheep

      • SnowGolem

      • Wolf - These have several states that can be used.

        • Wolf_Angry - AKA "hostile" Wolves. The ones complete with all-new growling and red-eye features.

        • Wolf_Tame - A Wolf whose loyalty has been declared to a player (with the "soft" eyes).

        • Wolf_Wild - Wolves. As nature built them.

    • Human - Your favorite pink squishies.

      • NPC - These are "monster" type humans that are spawned in some plugins. Most MC players don't ever see them.

      • Player - What does it sound like?

      • Villager - We could nickname them "The Schozzbournes".

    • Mob - everything else.

      • Blaze

      • CaveSpider - Koryu HATES these.

      • Creeper - Lovable suicidal shrubs. These have two states.

        • Creeper_Charged - A Creeper that's activating its Limit Attack?!...err...no. Charged Creepers have been struck by lightning, and have a blue glow effect surrounding them.

        • Creeper_Normal - Just an ordinary Creeper.

      • Enderman

      • Ghast

      • Giant

      • MagmaCube

      • Mooshroom

      • Skeleton

      • Silverfish

      • Slime

        • Slime_Small

        • Slime_Medium

        • Slime_Large

        • Slime_Huge

        • Slime_Other - Anything larger than the above, produced by a plugin.

      • Spider

        • Spider_Jockey - SKELETON CAVALRY! D:

        • Spider_Riderless - A bareback Spider.

      • Zombie

      • ZombiePigman

  • Nonliving

    • Nature - These can be delightfully confusing, and shall be annotated.

      • Burn - See "fire". And maybe Webster's for "screwed".

      • Cactus - Pokey pokey.

      • Drowning - Swimming along, you run out of air...is it all over?

      • Explosion - Works for TNT, not entirely sure about something like fireballs.

        • Explosion_Block - The only time this seems to be used as of build 1060 is when an explosion is directly generated by a plugin.

        • Explosion_Entity - Used basically everywhere else.

      • Fall - ModDamage - 9001, Gravity - 0

      • Fire - "fire" is exposure to a fire block..."burn" is damage taken after you survive that exposure.

      • Lava - Lava's a different story altogether. But still just a block.

      • Lightning - crackBOOOOOM. It should be noted that a lot of fire damage is associated with lightning strikes.

      • Starvation

      • Suffocation - Differs from drowning because this is block-based (sand/gravel)

      • Suicide

      • Void - Bottomless pits are so original.

    • Projectile

      • Arrow - fired by a Skeleton or a human.

      • Egg - thrown by a human.

      • Fireball - Usually seen being spat by a Ghast.

      • FishingRod - the "hook" of a fishing rod?

      • Snowball - self-explanatory, I hope.

    • Trap

      • Dispenser

SECTION A - "What Damage-related Events Can I Change With ModDamage?"

A.01 - Damage

Damage is an event fired whenever...well...whenever something living takes damage! Manipulating this event is simple. Use routines to alter the event's value. Valid entities for this event are Attacker, Projectile (if it exists), and Target.

Damage events are demonstrated from the very beginning of the MD tutorials.

A.02 - Death

Death routines are also self-explanatory. Unlike the Damage event, there's no way to change the outcome of this event - the entity's going to die, no matter what value-manipulation routines you use. The most useful routines here will likely be Message or Calculation routines that do something interesting to the last attacker or the event's world. Valid entities are the same as in Damage - Attacker, Projectile (if it exists), and Target.

A.03 - Food

Food routines are fired whenever a player consumes an item.

A.04 - Heal

Heal routines are fired whenever a player is healed from being satiated. The event value affects how much health is restored, and is manipulable like the Spawn and Damage event. The Target is the only valid entity in this event. Resulting values less than or equal to 0 cancel the event.

A.05 - ProjectileHit

Eat routines are fired whenever a player uses a food item to heal themselves. The event value is manipulable, like the Spawn and Damage event. Resulting values less than or equal to 0 cancel the event. Valid entities for this event are Projectile and Target, which refers to the shooter (if it's alive).

A.06 - Spawn

Spawn routines are fired when a living creature spawns - animals, mobs, or humans. This event value is manipulable, and resulting values of 0 or less will cancel the event. The only entity in this event is the Target.

A.07 - Tame

Tame routines are fired whenever a Wolf gets tamed. Set the event value to a nonpositive integer to cancel it.

SECTION B - "How do I tinker with these damage relationships?"

[B.01] - Calculations

Uses a value calculated from nested routines to do something. Keep in mind that event values are preserved, so if you need a static value you should use a Set routine at the beginning.

- 'targeteffect.explode': 'set.9001' #Don't actually do this.

All value-manipulating routines do NOT affect the event's value if they are nested under a Calculation routine.

[B.02] - Conditionals

The primary control branch in ModDamage. Use Conditionals to control whether or not the nested routines will execute. See the second tutorial for more information on Conditionals.

- 'if condition':
    - 'routine'
    - 'if another.condition':
        - 'another.routine'
- 'if_not firstcondition and secondcondition': #If_not inverts the entire conditional.
    - 'yet.another.routine'
- 'if condition_one or condition_two or !condition_three': #Condition_three is inverted.
    - 'umpteenth.routine'

[B.03] - Switches

Similar to switches in Java, these are used for more refined control branching than simple conditionals. With Switches, cases are checked sequentially until either a match has been found, or there are no cases left to evaluate. Only the matched case's routines are executed.

- 'switch.something':
    CaseOne: 'single.routine'
    
    CaseTwo:
        - 'nested.routine'
    
    [...]

    LastCase:
        - 'another.routine'
        - 'yet.another.routine'

Some switches uses aliases as cases - see below for more details.

[B.04] - Routines: Exhaustively Listed Here

###Routines by Category

Event Value

Entity/Mob

Player

World

Server

###Routines by Type

Base

Calculation

Conditional

Switch

Section C: Miscellaneous Config and FAQs

[C.01] - Miscellaneous Configuration

This briefly describes each of the single-property configurations in ModDamage.

  • "debugging" changes how verbose your console output when using ModDamage (primarily for loading/reloading information). There are three modes:

    • "verbose" is for people who don't want to talk to ModDamage's very active dev, or like wading through lots of probably useless information. By the same token, if you're truly determined to figure out what's going wrong with your configuration without external support, this is the way to go.

    • "normal" prints out each valid configuration node that is found upon load/reload. This is on by default, since new users that have not configured this will likely want to be able to see this input (i.e., they have an unrecognized node name)

    • "quiet" suppresses all but critical errors and warnings that ModDamage might be thrown. When you're sure you've got the configuration you want on your server, it's suggested you use this to stop spamming your console with information that you already know.

debugging: normal
  • Tagging

    • "interval-save" is the time, in seconds, between automatic saves of tags ingame.

    • "interval-clean" is the time, in seconds, between automatic cleanups of tags ingame. This prunes any entities that no longer exist from the tag cache.

Tagging:
    interval-save: 120
    interval-clean: 120

[C.02] - Frequently Asked Questions

FAQ: How do I debug in MD? FAQ: How do I detect whether a player is critting in vanilla MC? FAQ: How do I report ModDamage bugs feature requests? FAQ: Is it possible to have a delayed effect in ModDamage? FAQ: I want to talk with the ModDamage developer for (insert reason here). How can I get ahold of him? FAQ: How do I use ArmorSets? FAQ: How do I use tagging? FAQ: Is it possible to have a delayed effect in ModDamage? FAQ: What are aliases?

Clone this wiki locally