Interface IAbility

    • Method Detail

      • getId

        String getId()
        Get the unique ID (UUID for custom abilities, registry key for built-in). This is the stable reference that never changes after creation.
        Returns:
        the unique ability ID
      • setId

        void setId​(String id)
        Set the unique ID of this ability instance.
        Parameters:
        id - Unique ability ID.
      • getName

        String getName()
        Get the unique identifier/name of this ability (used for file naming, commands, search).
        Specified by:
        getName in interface IAbilityAction
        Returns:
        The unique identifier/name of this action.
      • setName

        void setName​(String name)
        Set the unique identifier/name of this ability.
        Parameters:
        name - Unique identifier.
      • getDisplayName

        String getDisplayName()
        Get the display name (cosmetic). Falls back to getName() if not set.
        Returns:
        the display name
      • setDisplayName

        void setDisplayName​(String displayName)
        Set the display name (cosmetic). Pass empty string to use getName() as display.
        Parameters:
        displayName - Display name, or empty string for default.
      • getTypeId

        String getTypeId()
        Get the type ID of this ability (e.g., "cnpc:slam", "cnpc:beam").
        Returns:
        the type ID
      • isEnabled

        boolean isEnabled()
        Check if this ability is enabled.
        Specified by:
        isEnabled in interface IAbilityAction
        Returns:
        Whether this action is enabled.
      • setEnabled

        void setEnabled​(boolean enabled)
        Enable or disable this ability.
        Parameters:
        enabled - Whether the ability is enabled.
      • getWeight

        int getWeight()
        Get the selection weight for random ability selection. Higher weight = more likely to be selected.
        Specified by:
        getWeight in interface IAbilityAction
        Returns:
        Selection weight for random ability selection (higher = more likely).
      • setWeight

        void setWeight​(int weight)
        Set the selection weight.
        Parameters:
        weight - Selection weight (higher = more likely).
      • getMinRange

        float getMinRange()
        Get the minimum range at which this ability can be used.
        Specified by:
        getMinRange in interface IAbilityAction
        Returns:
        Minimum range in blocks at which this action can be used.
      • setMinRange

        void setMinRange​(float range)
        Set the minimum range.
        Parameters:
        range - Minimum range in blocks.
      • getMaxRange

        float getMaxRange()
        Get the maximum range at which this ability can be used.
        Specified by:
        getMaxRange in interface IAbilityAction
        Returns:
        Maximum range in blocks at which this action can be used.
      • setMaxRange

        void setMaxRange​(float range)
        Set the maximum range.
        Parameters:
        range - Maximum range in blocks.
      • getCooldownTicks

        int getCooldownTicks()
        Get the cooldown time in ticks.
        Specified by:
        getCooldownTicks in interface IAbilityAction
        Returns:
        Cooldown duration in ticks after this action is used.
      • setCooldownTicks

        void setCooldownTicks​(int ticks)
        Set the cooldown time in ticks.
        Parameters:
        ticks - Cooldown duration in ticks.
      • getWindUpTicks

        int getWindUpTicks()
        Get the wind-up time in ticks (telegraph phase).
        Returns:
        wind-up time in ticks
      • setWindUpTicks

        void setWindUpTicks​(int ticks)
        Set the wind-up time in ticks.
        Parameters:
        ticks - Wind-up duration in ticks.
      • getDazedTicks

        int getDazedTicks()
        Get the dazed time in ticks (stun after interrupt during WINDUP).
        Returns:
        dazed time in ticks
      • setDazedTicks

        void setDazedTicks​(int ticks)
        Set the dazed time in ticks.
        Parameters:
        ticks - Dazed duration in ticks.
      • isInterruptible

        boolean isInterruptible()
        Check if this ability can be interrupted by damage.
        Returns:
        true if interruptible
      • setInterruptible

        void setInterruptible​(boolean interruptible)
        Set whether this ability can be interrupted.
        Parameters:
        interruptible - Whether the ability is interruptible.
      • isIgnoreIFrames

        boolean isIgnoreIFrames()
        Check if this ability ignores target invulnerability frames (hurt resistance).
        Returns:
        true if ignoring invulnerability frames
      • setIgnoreIFrames

        void setIgnoreIFrames​(boolean ignore)
        Set whether this ability ignores target invulnerability frames (hurt resistance).
        Parameters:
        ignore - Whether to ignore invulnerability frames.
      • getLockMovementType

        int getLockMovementType()
        Get the lock movement type for this ability.
        Returns:
        0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE
      • setLockMovementType

        void setLockMovementType​(int type)
        Set the lock movement type for this ability.
        Parameters:
        type - 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE
      • getRotationModeType

        int getRotationModeType()
        Get the rotation mode for this ability.
        Returns:
        0=FREE, 1=LOCKED, 2=TRACK
      • setRotationModeType

        void setRotationModeType​(int type)
        Set the rotation mode for this ability.
        Parameters:
        type - 0=FREE, 1=LOCKED, 2=TRACK
      • getRotationPhaseType

        int getRotationPhaseType()
        Get the rotation phase for this ability (when rotation mode applies).
        Returns:
        0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE
      • setRotationPhaseType

        void setRotationPhaseType​(int type)
        Set the rotation phase for this ability.
        Parameters:
        type - 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE
      • getTrackSpeedValue

        float getTrackSpeedValue()
        Get track speed for TRACK rotation mode (blocks/second). 0 = instant tracking. Comparable to player sprint speed (~5.6 blocks/sec).
        Returns:
        track speed in blocks/second
      • setTrackSpeedValue

        void setTrackSpeedValue​(float speed)
        Set track speed for TRACK rotation mode (blocks/second).
        Parameters:
        speed - 0 = instant tracking. ~4 = dodgeable while sprinting. ~6 = barely undodgeable.
      • isMovementLockedDuringWindup

        boolean isMovementLockedDuringWindup()
        Check if movement (pathfinding/motion) is locked during the WINDUP phase.
        Returns:
        true if movement is locked during windup
      • isMovementLockedDuringActive

        boolean isMovementLockedDuringActive()
        Check if movement (pathfinding/motion) is locked during the ACTIVE phase.
        Returns:
        true if movement is locked during active phase
      • isRotationLockedDuringWindup

        boolean isRotationLockedDuringWindup()
        Check if rotation (yaw/pitch) is locked during the WINDUP phase.
        Returns:
        true if rotation is locked during windup
      • isRotationLockedDuringActive

        boolean isRotationLockedDuringActive()
        Check if rotation (yaw/pitch) is locked during the ACTIVE phase.
        Returns:
        true if rotation is locked during active phase
      • isExecuting

        boolean isExecuting()
        Check if this ability is currently being executed.
        Returns:
        true if currently executing
      • getPhaseInt

        int getPhaseInt()
        Get the current execution phase (0=IDLE, 1=WINDUP, 2=ACTIVE, 3=DAZED, 4=BURST_DELAY).
        Returns:
        the current phase ordinal
      • getCurrentTick

        int getCurrentTick()
        Get the current tick within the current phase.
        Returns:
        the current tick within the phase
      • getAllowedByType

        int getAllowedByType()
        Get the allowed user type for this ability.
        Returns:
        0=NPC_ONLY, 1=PLAYER_ONLY, 2=BOTH
      • setAllowedByType

        void setAllowedByType​(int type)
        Set the allowed user type for this ability.
        Parameters:
        type - 0=NPC_ONLY, 1=PLAYER_ONLY, 2=BOTH
      • isIgnoreCooldown

        boolean isIgnoreCooldown()
        Check if this ability ignores cooldowns.
        Returns:
        true if ignoring cooldowns
      • setIgnoreCooldown

        void setIgnoreCooldown​(boolean ignore)
        Set whether this ability ignores cooldowns.
        Parameters:
        ignore - Whether to ignore cooldowns.
      • isPerAbilityCooldown

        boolean isPerAbilityCooldown()
        Check if this ability uses per-ability cooldown instead of global cooldown. When true, using this ability only puts THIS ability on cooldown, not all abilities.
        Returns:
        true if using per-ability cooldown
      • setPerAbilityCooldown

        void setPerAbilityCooldown​(boolean perAbility)
        Set whether this ability uses per-ability cooldown.
        Parameters:
        perAbility - Whether to use per-ability cooldown.
      • getNbt

        INbt getNbt()
        Get this ability's data as NBT.
        Returns:
        the ability's NBT data
      • setNbt

        void setNbt​(INbt nbt)
        Set this ability's data from NBT.
        Parameters:
        nbt - NBT data to load.
      • isBurstEnabled

        boolean isBurstEnabled()
        Returns:
        Whether burst firing is enabled (fires multiple instances in rapid succession).
      • setBurstEnabled

        void setBurstEnabled​(boolean enabled)
        Parameters:
        enabled - Whether burst firing is enabled.
      • getBurstAmount

        int getBurstAmount()
        Returns:
        Number of times the ability fires per burst.
      • setBurstAmount

        void setBurstAmount​(int amount)
        Parameters:
        amount - Number of shots per burst.
      • getBurstDelay

        int getBurstDelay()
        Returns:
        Delay in ticks between each burst shot.
      • setBurstDelay

        void setBurstDelay​(int delay)
        Parameters:
        delay - Delay in ticks between burst shots.
      • isBurstReplayAnimations

        boolean isBurstReplayAnimations()
        Returns:
        Whether animations replay for each burst shot.
      • setBurstReplayAnimations

        void setBurstReplayAnimations​(boolean replay)
        Parameters:
        replay - Whether to replay animations per burst shot.
      • isBurstOverlap

        boolean isBurstOverlap()
        Returns:
        Whether burst shots can overlap (fire before previous shot ends).
      • setBurstOverlap

        void setBurstOverlap​(boolean overlap)
        Parameters:
        overlap - Whether burst shots can overlap.
      • isToggleable

        boolean isToggleable()
        Check if this ability is toggleable (has at least 1 toggle state).
        Returns:
        true if toggleable
      • getToggleStates

        int getToggleStates()
        Get the number of toggle states. 0 = not toggleable, 1 = binary on/off, 2+ = multi-state cycling.
        Returns:
        number of toggle states
      • setToggleStates

        void setToggleStates​(int states)
        Set the number of toggle states. 0 = not toggleable, 1 = binary on/off, 2+ = multi-state cycling.
        Parameters:
        states - Number of toggle states.
      • getToggleStateLabel

        String getToggleStateLabel​(int state)
        Get the display label for a specific toggle state (1-indexed).
        Parameters:
        state - Toggle state number (1-indexed).
        Returns:
        the label, or null if none set.
      • getMagicData

        IMagicData getMagicData()
        Get this ability's magic data. Defines magic types, damage splits, and flat magic damage for this ability. Inherited by spawned energy entities.
        Returns:
        the ability's magic data