Class Element

java.lang.Object
com.hypixel.hytale.builtin.abilities.element.Element
All Implemented Interfaces:
JsonAsset<String>, JsonAssetWithMap<String, IndexedLookupTableAssetMap<String,Element>>

public class Element extends Object implements JsonAssetWithMap<String, IndexedLookupTableAssetMap<String,Element>>
An element of the ability system, keyed by id. An element ties a damage cause to a status: a conversion rune re-keys the supported ability's elemental damage to DamageCause, OnHitEffect is the status a hit of this element applies to its victim, and a victim holding an element-tagged status (Element=<id> asset tag) REACTS when hit by another element this element declares in Reactions. Elements never live on spells themselves; everything goes through damage causes and victim statuses.
  • Field Details

    • EFFECT_TAG_KEY

      @Nonnull public static final String EFFECT_TAG_KEY
      The prefix of the asset tag that marks a state effect as carrying an element: Tags: { Element: [<id>] } on the EntityEffect expands to Element=<id>.
      See Also:
    • CODEC

      @Nonnull public static final AssetBuilderCodec<String,Element> CODEC
  • Constructor Details

    • Element

      public Element()
    • Element

      public Element(@Nonnull String id)
  • Method Details

    • getAssetStore

      @Nonnull public static AssetStore<String, Element, IndexedLookupTableAssetMap<String,Element>> getAssetStore()
    • getAssetMap

      @Nonnull public static IndexedLookupTableAssetMap<String,Element> getAssetMap()
    • getId

      public String getId()
      Specified by:
      getId in interface JsonAsset<String>
    • getDamageCauseId

      @Nonnull public String getDamageCauseId()
    • getOnHitEffectId

      @Nullable public String getOnHitEffectId()
    • getReaction

      @Nullable public Element.Reaction getReaction(@Nonnull String triggerElementId)
    • getEffectTagIndex

      public int getEffectTagIndex()
      Returns:
      the tag index a state effect carries when it belongs to this element.
    • resolveElementColor

      @Nullable public static Color resolveElementColor(@Nullable ImpactModifiers impactModifiers, @Nullable Color fallback)
      Resolves the display color of an entity's element conversion: the converted damage cause's damage text color, so visuals and damage numbers always match. Returns fallback when the entity carries no conversion or the cause has no color.