Skip to content

Releases: Provismet/CombatPlus-Core

3.1.0 - 1.21.4

05 Dec 21:20
Compare
Choose a tag to compare

Changes

  • Updated to 1.21.4 Minecraft.

3.1.0 - 1.21.3

30 Nov 21:54
Compare
Choose a tag to compare

Additions

  • [LilyLib] Added an equipment model datagen provider.

Changes

  • Updated to 1.21.3 Minecraft.
  • [LilyLib] Enchantment containers require a entity registry lookup.

1.1.0 - 1.20.4

15 Sep 13:58
Compare
Choose a tag to compare

Minor patch to enable a fix for a niche compatibility issue in Dual Swords.

Additions

  • Melee weapons now have a stack-aware version of getWeaponDamage.
  • Dual weapons now have a stack-aware version of getOffhandDamage.

1.1.0 - 1.20.1

15 Sep 13:55
Compare
Choose a tag to compare

Minor patch to enable a fix for a niche compatibility issue in Dual Swords.

Additions

  • Melee weapons now have a stack-aware version of getWeaponDamage.
  • Dual weapons now have a stack-aware version of getOffhandDamage.

3.1.0 - 1.21

25 Jul 22:26
Compare
Choose a tag to compare

Additions

  • Added gamerule (lethalPoison) to toggle whether poison can be lethal.
    • Includes new related damage type.
  • Sweeping attacks now apply Combat+ post-charged hit effects to all affected entities.
  • Enchanted Numerals now grants translation keys for 0 to 10.
  • [LilyLib] Added datagen provider for assets/.../sounds.json
  • [LilyLib] Added datagen provider for particle textures.
  • [LilyLib] Added wrapper provider for the Fabric language datagen provider.
    • This provides common useful functions: adding enchantments with their descriptions (for inter-mod compatibility), and adding simple death translations.

Changes

  • pvpEnchantmentModifier now has a minimum value of 0.
  • #combat-plus:standard_attack tag includes the vanilla is_player_attack tag instead of the individual player attack.

3.0.0 - 1.21

14 Jul 16:26
49ccbbd
Compare
Choose a tag to compare

Note

Jitpack doesn't let you add hotfixes to already existing releases; do not use tag 3.0.0-mc1.21 for dependencies.
Use 3.0.0-1-mc1.21 instead for the updated LilyLib flat particles.

Major patch to finally bring Combat+ into the world of 1.21, this update completely rewrites literally everything that even remotely interacted with enchantments.

For obvious reasons, version 3.0.0 contains breaking changes for almost everything.

Brief Overview

Yes, this is the brief version...

Additions

  • Combat+ Core now reveals LilyLib to dependent mods.
    • LilyLib was already bundled in the jar, it's just made available now.
    • LilyLib patch notes will be included in Combat+ patch notes.
  • Added several new enchantment components types:
    • combat-plus:post_charged_attack
    • combat-plus:post_critical_attack
    • combat-plus:post_kill
    • combat-plus:bonus_damage
      • So items that are not the primary weapon can increase damage too.
    • combat-plus:gamerule_damage
      • Damage dealt against players is modified by the new gamerule.
      • This allows for world-based PvP balancing.
  • New gamerule that modifies enchantment damage effectiveness against players.
    • Extra Damage Enchantments and Extended Enchanting both had their seperate versions of this gamerule before. They have been moved into Combat+ now.
  • Added a small library of common effects and conditions for enchantments.
  • Added a new type of enchantment effect: Double Entity Effect
    • This is used by the Combat+ components and allows for effects for consider two entities at once.
  • Added two built-in resource packs:
    • One provides Roman Numerals for enchantments with a level over 10 (up to 255).
    • One replaces Roman Numerals for enchantment levels with plain numbers (up to 255).
  • Vanilla Maces are considered melee weapons by Combat+.
  • Added two new loot functions.

Changes

  • Sharpness, Smite, Bane of Arthropods, and Fire Aspect are now overriden entirely by Combat+ Core to change their supported item tags.
    • Previously a mixin was used to change the tags instead.
    • Smite and Bane of Arthropods use the new combat-plus:gamerule_damage component.
  • The enchantment types of Combat+ (Additional Damage, Offhand, Weapon Utility, Aspect) have been converted into enchantment tags.
  • Combat+ Enchantment Helper methods have different parameters.

Removals

  • The entire old enchanting system. :(

New Features From LilyLib

  • Enchantment datagen provider
  • DamageType datagen provider
  • DamageType tag datagen provider
  • Enchantment Containers
    • Combines a registry key with an enchantment builder. Highly useful for eliminating code duplication if you need to bootstrap your enchantments.
    • Also contains useful utility for getting registry entries of the enchantment.
  • DamageType Containers
    • Combines a registry key with a damage type. Highly useful for eliminating code duplication.
    • Also has utility methods for generating damage sources.
  • Fabric resource condition to only load certain things when in dev mode.

More Details (useful for modders / datapackers / my future self)

This ended up being partially a dev blog.

With 1.21, Mojang rewrote the entire enchantment system, I had to do the same on my end too.

As of version 3.0.0, Combat+ Core has evolved from being a fairly simple compatibility layer. To accomodate the new enchantment system, it had to become a fully-fledged library.
With 4 different mods relying on Combat+ Core, it became necessary to expand everything about the project, to the point that now it can even be used standalone by datapackers.

Enchantment Component Types and Effect Types

The original functionality of Combat+ Core was to provide hooks for 3 key combat events. These events have now been converted into enchantment components:

  • combat-plus:post_charged_attack
  • combat-plus:post_critical_attack
  • combat-plus:post_kill

The call order remains the same and this can be tested with the debug enchantment.

The three components accept a new type of enchantment effect: a double-entity effect, CPCEnchantmentEntityEffect. (It took a lot of strength to not name it bientity, after I already borrowed the idea from Origins/Apoli.)
The double-entity effect considers both the attacker and the target at once, an example would be knockback. Knockback depends on the angle between two entities.

Unlike the poorly thought-out vanilla post-attack component, these only trigger from the attacker.

  • The attacker takes the THIS_ENTITY loot parameter and the ATTACKING_ENTITY parameter in code.
  • The target takes a new TARGET_ENTITY loot parameter in code.

Not many double-entity effects have been added, but most importantly there are the following:

  • combat-plus:apply_to_owner
    • Applies a single-entity effect (such as the vanilla ones or some of the new ones) to the owner of the enchantment (the attacker).
  • combat-plus:apply_to_target
    • Similar to the above, but applies to the target.
  • combat-plus:apply_to_both
    • Similar to the above, but applies it to both.
  • combat-plus:invert
    • Calls another double-entity effect, but with the attacker and target flipped.

Because the single-entity effects are the most expansive, I expect these to be used the most. Though there are additionally also effects that trigger Combat+ weapon effects too.

Damage

In the past, there was an issue of damaging enchantments being too powerful when used against players; this was mainly relevant for Smite/Bane of Arthropods being very strong in certain modded PvP contexts, mainly Origins servers.

Extra Damage Enchantments was originally designed specifically with Origins (and Provi's Origins, which was still in its infancy) in mind. As such it created a gamerule that nerfed these conditional damage enchantments when they are used against players. The idea was for server owners to simply decide for themselves how they wanted this to play out.
Eventually Extended Enchanting came around and the desire for balance came again, so it implemented its own individual version of the same gamerule.

With 1.21 this was no longer possible. The gamerule could only be implemented by creatinga new component entirely, thus requiring divine (library) intervention. This introduces the combat-plus:gamerule_damage component.
The gamerule: pvpEnchantmentModifier controls how effective it is against players. For all other entities, it is equivalent to the vanilla damage component (which still works, of course).

As part of this, the Combat+ enchantment still fully overrides the vanilla one for damage.

The next relevant component is combat-plus:bonus_damage. The vanilla damage component only applies if the enchanted item is also the weapon, the gamerule variant copies this functionality too. Bonus damage instead comes from any equipped item that's in the correct slot, it is also unaffected by the gamerule.

Enchantments, Effects, Conditions, and You

I added arbitrary code execution enchantment effects (and condition). You register lambda methods to Combat+ Core and have pass the identifier to the enchantment. This should single-handedly solve every case of "I have to do something extremely specific but don't know how."

Outside of that, as mentioned above Combat+ Core now aims to be full library. It contains many enchantment effects and conditions now in an attempt to reduce the need for dependent mods to implement their own.

Most interesting, though, are the conditions. I believe that Mojang absolutely dropped the ball when it came to the conditions. The vanilla predicate conditions are clunky and awful to work with; instead I have taken inspiration from Origins/Apoli and implemented several conditions that are more specific and more dynamic.

The conditions can be split into single-entity and double-entity variants. The vanilla EntityPropertiesCondition would be equivalent to a single-entity condition.
All single-entity conditions apply to the THIS_ENTITY parameter. The vanilla components can be VERY inconsistent about which entity is the THIS_ENTITY, so take caution. For example, minecraft:damage treats the target as the THIS_ENTITY, and minecraft:post_attack alternates who is THIS_ENTITY based on parameters.

Single-entity loot contexts provide the following parameters:

  • THIS_ENTITY
  • ENCHANTMENT_LEVEL
  • ORIGIN
  • TOOL (the entity's weapon)

Double-entity loot contexts provide the following parameters:

  • THIS_ENTITY (the attacker)
  • ATTACKING_ENTITY (the attacker)
  • TARGET_ENTITY
  • ENCHANTMENT_LEVEL
  • ORIGIN
  • TOOL (the attacker's weapon)

Most single-entity conditions don't require the tool parameter though, meaning they can be used in vanilla contexts.

Combat+ Core now offers the following single-entity conditions

  • combat-plus:apply_to_attacker
    • Creates a new single-entity context where THIS_ENTITY = ATTACKING_ENTITY, then applies a provided single-entity condition.
  • combat-plus:apply_to_item
    • Applies a provided item condition to the TOOL.
  • combat-plus:dimension
    • Checks what dimension the entity is in.
  • combat-plus:exposed_to_sky
  • combat-plus:exposed_to_sun
  • combat-plus:exposed_to_moon
  • combat-plus:health
    • Checks the entity's health against a value (you decide the operator).
  • combat-plus:relative_health
    • Checks the entity's health percentage against a value (you decide the operator).
  • combat-plus:code_execution_single_entity_condition
    • Applies a hardcoded condition from code (you must register your lambda condition).
    • This is intended for modders (obviously), but technically datapackers can use functions provided by modders.
    • Use this for highly specific things that would be hard to create dedicated conditions for.
  • combat-plus:every_x_ticks
    • Return...
Read more

2.0.1 - 1.20.6

21 Jun 16:56
Compare
Choose a tag to compare

Patch update to add some little features before updating to the gauntlet that is 1.21.

Additions

  • Development environments now have access to a debug enchantment and item, these use their callbacks for console logs. This is to help developers assess when callbacks are workings.
  • Enchantments that use the Combat+ enchantability tags will now appear in the Creative Mode inventory.

2.0.0 - 1.20.6

26 May 19:11
Compare
Choose a tag to compare

Major release that includes some breaking changes to account for Mojang's own breaking changes in 1.20.5/6.

Additions

  • Added abstract class for melee weapons.
  • Added enchantability item tags for the 4 new item groups + primary versions of these tags.
  • Vanilla enchantments now use Combat+ item tags for when appropriate.
    • The Combat+ tags extend the vanilla ones.
  • Added tag translations.

Changes

  • MeleeWeapon.getWeaponDamage now requires an ItemStack parameter.
  • Combat+ enchantment classes can no longer use the vanilla damage method, the Combat+ version should be used instead.
  • CombatTags has been renamed to CPCItemTags.

Removals

  • FabricASM is no longer used or included by Combat+. (Hurray!)

1.0.0 - 1.20.4

12 Feb 18:04
Compare
Choose a tag to compare

Forward port of 1.20.1 full release. The very fact I had to do this is seriously making me consider just uploading LilyLib as its own mod.

1.0.0 - 1.20.1

12 Feb 18:01
Compare
Choose a tag to compare

Full release.