Skip to content

Addon Compatibilities

liopyu edited this page Apr 17, 2024 · 24 revisions

Iron's Spells Mob Registration Script

This script showcases the dynamic registration of entities capable of casting spells from the Iron's Spells Mod using the KubeJS addon, KubeJS Iron's Spells Mod.

//Register the spellcasting entity
StartupEvents.registry('entity_type', event => {
    event.create('wyrm', 'irons_spells_js:spellcasting')
        .onCancelledCast(entity => {
            //Execute code when the entity stops casting it's spell
            console.log('Cancelled spellcasting')
        })
        //Cast a spell for example when the entity jumps
        .onLivingJump(entity => entity.initiateCastSpell(SpellRegistry.BLOOD_SLASH_SPELL.get(), 1))
})
  • Entity Type Registration: Registers a new entity type, "wyrm", associated with spellcasting capabilities.

MrCrayfish's Gun Mod Compatibility

This script demonstrates how to integrate compatibility with MrCrayfish's Gun Mod by registering a new entity type, "mymissile", associated with the "ammo" entity from the mod. This uses geckolib/liolib model/texture/geo files as any other geo entity would giving you full geckolib animation/model support.

Script:

StartupEvents.registry("entity_type", event => {
    event.create("mymissile", "cgm:ammo")
        .onHitEntity(context => {
            // Execute code when the ammo hits an entity
            console.log(context.entity);
        })
        .explosionEnabled(true);
});
Clone this wiki locally