-
Notifications
You must be signed in to change notification settings - Fork 3
Addon Compatibilities
liopyu edited this page Apr 5, 2024
·
24 revisions
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.
(Due to package changes in newer EntityJS versions, KJSIron's Spells 1.1.2 and below requires EntityJS 1.20.1-0.0.8/1.19.2-0.0.9 and below)
//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.