Class EnchantmentDesc

All Implemented Interfaces:, java.lang.Cloneable, HasEntrySet<EnchantmentDescArg,​java.lang.Object>, AbstractEnchantmentDesc<Enchantment>

public final class EnchantmentDesc
extends java.lang.Object
implements, java.lang.Cloneable, HasEntrySet<EnchantmentDescArg,​java.lang.Object>, AbstractEnchantmentDesc<Enchantment>
Data specifying a trigger, including what event it reacts to, what spell it casts, and various options. Each field in this class corresponds directly to a field that appears in the JSON whenever an EnchantmentDesc is expected. In other words, an EnchantmentDesc looks like:
    "eventTrigger": { An object corresponding to an EventTriggerDesc }
    "spell": { An object corresponding to a SpellDesc }
    "oneTurn": A boolean indicating that this Enchantment lasts one turn.
    "maxFires": The maximum number of times this enchantment will fire until it expires.
    "countUntilCast": The minimum number of times this enchantment must fire until its spell is cast
    "persistentOwner": See persistentOwner
    "keepAfterTransform": See keepAfterTransform
    "countByValue": See countByValue

This object is used to create an Enchantment using its create() function whenever entities like actors come into play with a CardDesc.trigger specified.

For example, the following JSON would belong on the CardDesc.trigger field to describe a minion that draws a card whenever it is damaged, up to 3 times:

         "eventTrigger": {
             "class": "DamagedReceivedTrigger",
             "hostTargetType": "IGNORE_OTHER_TARGETS"
         "spell": {
             "class": "DrawCardSpell",
             "targetPlayer": "SELF"
         "maxFires": 3
Note, this is distinct from an EventTriggerDesc or EventTrigger, which defines how to react to which events in game.
See Also:
for more about enchantments., to see where can typically go., Serialized Form