header
premium banner

Description

Invincible 无坚不摧

Custom datapack work in server since 20.9.6 but it's unstable.

The 1.18 version doesn't have datapack support.

Translated from github README by AI. The wiki tells more detail than here.

This mod provides 4 keyMappings to help you create complex key combination combos for epic fight weapon type.

for example, you can create AABB, AAAB, BBAB, AB, AAB… (i hope you can know what i'm saying with my poor English)

Acknowledgements

Thank you to SettingDust, Cyber2049, and dfdyz for their guidance and assistance.

Introduction

This is a support library designed to facilitate the registration of epic combat combo data for code developers and data pack creators. It allows for the convenient construction of new weapon templates and supports many specific features, similar to Indestructible.

Code Example

Test Item: invincible:debug can be obtained using the give command. When using this item, the console will print the current key input information.

The principle is simple: the weapon combo data is saved as a skill, replacing the original WeaponInnate skill. Then, custom input handling is written, and a skill execution request is initiated. The input part implements delayed packet sending and pre-stored input, supports dual keys, and allows custom keys and corresponding combo types.

Skill Template Registration

Weapon Template Registration

Sample Project

In this sample project, the Skill is inherited from the ComboBasicAttack skill provided by the mod, which means you can override the Skill#getTooltipOnItem method to add skill descriptions. Similarly, you can use it as a normal skill class, such as subscribing to events, adding Datakey, and implementing features like sheathing or charging.

Custom Keys and Combo Type Enum

First, implement the enum type ComboType. Then, register and assign IDs in the main class. Finally, subscribe to the FMLClientSetupEvent event and use InputManager.register() to bind keys and custom combo type enums. After registration, for each ComboNode, you can use addChild or addLeaf to add your own combo types triggered by the combo.

Datapack Example

Test Item: invincible:datapack_debug can be obtained using the give command. When using this item, the console will print the current key input information.

First, you need to register combo data, which essentially registers a new skill: Example

Next, register the weapon template as usual: Example

Note that the combos in the template should not be left empty; fill it with some data because the template still relies on the original method. Ensure the style matches, and then fill the innate skill with the mod_id:name of the registered combo data.

Finally, apply it to your weapon: Example

Currently Available Commands

  • /invincible entityAfterImage entity - Leaves an afterimage at the entity's location.

  • /invincible groundSlam entity radius noSound noParticle hurtEntities - Generates a ground slam effect at the entity's location. The last four parameters are boolean values.

  • /invincible setPlayerPhase value - Sets a custom player phase, used in conjunction with ["invincible:phase"](#currently-supported-condition-explanations).

  • /invincible setStack value - Sets the skill stack count.

  • /invincible consumeStack value - Consumes the skill stack count.

  • /invincible setConsumption value - Sets the charge value.

  • /invincible consumeConsumption value - Consumes the charge value.

Currently Available Configurations

Located in config/invincible-common.toml.

  • effect_tick - The duration in ticks after a successful parry/dodge during which the corresponding condition is met. Default is 20 ticks.

  • reset_tick - The time to reset the combo. Default is 16 ticks.

  • reserve_tick - The pre-stored input time. Only effective when modified on the client side. Default is 8 ticks.

  • input_delay_tick - The input delay time. Only effective when modified on the client side. Default is 4 ticks.

Currently Supported Datapack Parameters

If you are familiar with indestructible, you should be able to get started quickly.

  • "key": The key required for the current animation. Supported keys are KEY_1, KEY_2, KEY_3, KEY_4, KEY_1_2, KEY_1_3, KEY_1_4, KEY_2_3, KEY_2_4, KEY_3_4. KEY_1_2 represents pressing KEY_1 and KEY_2 simultaneously.

  • "animation": The animation to be played. Some animations may not be usable due to weapon restrictions.

  • "speed_multiplier": An integer representing the playback speed multiplier of the attack animation. Note that the player's attack animation speed is affected by the weapon's attack speed.

  • "convert_time": An integer representing the transition time of the animation.

  • "damage_multiplier": Modifies the damage value of the attack animation. Options include setter, multiplier, and adder. Note that this replaces the original damage multiplier of the animation, not stacking, but does not affect the weapon's base stats.

  • "impact_multiplier": Modifies the impact multiplier of the attack animation. Note that this replaces the original impact multiplier, not stacking.

  • "stun_type": Modifies the stun type of the attack animation. Options include NONE, SHORT, LONG, HOLD, KNOCKDOWN, NEUTRALIZE, and FALL. Refer to the Epic Fight wiki for details.

  • "hurt_damage_multiplier": Modifies the damage taken during the animation.

  • "set_phase": An integer representing the phase the player enters after the animation starts. Used with the custom condition ["invincible:phase"](#currently-supported-condition-explanations).

  • "cooldown": An integer representing the cooldown ticks the player enters after the animation starts. Used with the custom condition ["invincible:cooldown"](#currently-supported-condition-explanations).

  • "not_charge": A boolean value indicating whether the animation's damage will charge. Suitable for skill animations.

  • "time_command_list": A list of timestamp events executed at specific points during the animation. Affected by playback speed. For each element:

    1. "time": The playback time point, a float.
    2. "command": The command to execute, a string.
    3. "execute_at_target": Whether to execute the command on the target, a boolean.
  • "hurt_command_list": A list of events executed when the player is hit during the animation.

    1. "command": The command to execute, a string.
    2. "execute_at_target": Whether to execute the command on the target, a boolean.
  • "hit_command_list": A list of events executed when the player successfully deals damage during the animation. Parameters are the same as above.

  • "dodge_success_command_list": A list of events executed when the player successfully dodges during the animation. The animation should be a dodge animation; otherwise, it is invalid. Parameters are the same as above.

  • "conditions": The conditions required for execution. Note that you cannot control different animations for the same input based on different conditions. Use condition_animations if needed.

    1. "predicate": The type of condition. Supports all Epic Fight conditions and conditions from other mods.
    2. Parameters required for each predicate. Conditions provided by invincible are explained below. Refer to other mods' documentation for their conditions.

Currently Supported Condition Explanations

This list does not include all conditions. Conditions from Epic Fight and other add-ons can also be used. Conditions used by this add-on.

  • invincible:jumping: Executes when the player is jumping. This skill replaces the original jump and sprint attacks, so this is a compensation.

  • invincible:sprinting: Executes when the player is sprinting. This skill replaces the original jump and sprint attacks, so this is a compensation.

  • invincible:stack_count: Checks the player's skill stack count. Typically used with the command ["/invincible consumeStack 1"](#currently-available-commands).

    1. "min": The minimum value of the player's skill stack.
    2. "max": The maximum value of the player's skill stack.
  • invincible:phase: Checks the player's custom state.

    1. "min": The minimum value of the player's custom state.
    2. "max": The maximum value of the player's custom state.
  • invincible:target_blocking: Checks if the target is blocking. Only works for monsters if indestructible is installed.

  • invincible:cooldown: Checks the skill's cooldown state. Typically used with ["cooldown"](#currently-supported-datapack-parameters).

    1. "inCooldown": A boolean indicating whether the player is in cooldown. Typically set to false.
  • invincible:dodge_success: Checks if the player is within the successful dodge window. The duration matches EFFECT_TICK in the config.

  • invincible:parry_success: Checks if the player is within the successful parry window. The duration matches EFFECT_TICK in the config.

  • invincible:up: Checks if the up key is pressed.

  • invincible:down: Checks if the down key is pressed.

  • invincible:left: Checks if the left key is pressed.

  • invincible:right: Checks if the right key is pressed.

Special Parameter "condition_animations"

Refer to Code Example or Datapack Example.

This parameter is used to control different animations for the same key under different condition groups. When condition_animations is present, only the "key" and "combos" parameters at the same level are valid; others are ignored.

Each element in "condition_animations" can use all the parameters mentioned above. Note that each element can also contain a combos array. When the combos parameter exists, the next combo table will follow the combos at the same level as the executed animation. If it does not exist, the outer combos will be used.