Skip to content

Instantly share code, notes, and snippets.

@dot-mike
Created July 27, 2026 20:30
Show Gist options
  • Select an option

  • Save dot-mike/21787a76b9fc02f088cefbe674b5e4de to your computer and use it in GitHub Desktop.

Select an option

Save dot-mike/21787a76b9fc02f088cefbe674b5e4de to your computer and use it in GitHub Desktop.
KubeJS fixes for ATM10 mod Irons' Spell 'n Spellbooks. Restores pre 3.16 behaviour to dead king so it can be farmed again!
{
"type": "minecraft:entity",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "irons_spellbooks:arcane_essence",
"functions": [
{
"function": "minecraft:set_count",
"add": false,
"count": { "type": "minecraft:uniform", "min": 28.0, "max": 45.0 }
},
{
"function": "minecraft:enchanted_count_increase",
"enchantment": "minecraft:looting",
"count": { "type": "minecraft:uniform", "min": 2.0, "max": 6.0 }
}
]
}
]
},
{
"rolls": 1,
"conditions": [
{ "condition": "minecraft:killed_by_player" },
{
"condition": "minecraft:random_chance_with_enchanted_bonus",
"enchantment": "minecraft:looting",
"unenchanted_chance": 0.50,
"enchanted_chance": { "type": "minecraft:linear", "base": 0.55, "per_level_above_first": 0.05 }
}
],
"entries": [
{ "type": "minecraft:item", "name": "irons_spellbooks:blood_staff" },
{ "type": "minecraft:item", "name": "irons_spellbooks:necronomicon_spell_book" }
]
},
{
"rolls": 1,
"entries": [
{ "type": "minecraft:item", "name": "irons_spellbooks:blank_rune" }
]
},
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "irons_spellbooks:scroll",
"functions": [
{ "function": "irons_spellbooks:randomize_spell", "quality": { "min": 0.5, "max": 1.0 } }
]
}
]
}
]
}
// put dead_king_fixes.js file in kubejs/server_scripts/Tweaks/
// put dead_king.json file in kubejs/data/irons_spellbooks/loot_table/entities/
// Awakened boss keeps AI when the corpse spawns it -> force NoAI (no casting/flying/teleport).
EntityEvents.spawned('irons_spellbooks:dead_king', event => {
event.entity.setNoAi(true)
})
// Prevent the Dead King Soul from spawning after killing dead king
const $EntityJoinLevelEvent = Java.loadClass('net.neoforged.neoforge.event.entity.EntityJoinLevelEvent')
NativeEvents.onEvent($EntityJoinLevelEvent, event => {
if (event.entity.type === 'irons_spellbooks:dead_king_soul') event.setCanceled(true)
})
// Alternative to NoAI: Block only Blood Step teleport spell
// const $SpellTeleportEvent = Java.loadClass('io.redspace.ironsspellbooks.api.events.SpellTeleportEvent')
// NativeEvents.onEvent($SpellTeleportEvent, event => {
// if (event.entity.type === 'irons_spellbooks:dead_king') event.setCanceled(true)
// })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment