Thelnfamous1 / Better-Mob-Combat

An add-on mod to Better Combat that allows it to work with (humanoid) mobs.
Creative Commons Zero v1.0 Universal
6 stars 2 forks source link

Incompatibility with Iron's Spells and Spellbooks #14

Open squoshi opened 3 months ago

squoshi commented 3 months ago

This is a bit of an odd and niche issue because ISS nor any of its addons utilize ISS's WarlockAttackGoal by default, but I've come across this issue when utilizing KubeJS, KubeJS Iron's Spells, and EntityJS. When the WarlockAttackGoal is active, the mob's melee attacks do not utilize Better Mob Combat functionality.

If you need to test the script I'm using for it, please go ahead. It requires all the mods listed above. It goes in a .js file in the kubejs/server_scripts folder:

const $WarlockAttackGoal = Java.loadClass('io.redspace.ironsspellbooks.entity.mobs.goals.WarlockAttackGoal')

EntityJSEvents.addGoalSelectors('minecraft:husk', event => {
    event.arbitraryGoal(1, (e) => {
        return new $WarlockAttackGoal(e, 1, 40, 50, 2)
            .setMeleeBias(0.8, 0.8)
            .setAllowFleeing(false)
            .setSpells(
                [Spell.of('irons_spellbooks:firebolt'), Spell.of('irons_spellbooks:magic_missile')],
                [Spell.of('irons_spellbooks:slow')],
                [],
                []
            )
    })
})

https://github.com/user-attachments/assets/9642a4ec-bdae-40e1-bf50-1a7f31956cf8

squoshi commented 3 months ago

I forgot to mention that I'm using a datapack for air punching. I'll list it here in a moment.

squoshi commented 3 months ago

punch.zip Here's the datapack.

Thelnfamous1 commented 3 months ago

Yeah, I haven't added any special support for their WarlockAttackGoal. I can add it.

squoshi commented 2 months ago

Any news on this? I couldn't fix the issue myself.