#ISS priest on death turns into a Necromancer
26 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
try this
const $ResourceKey = Java.loadClass("net.minecraft.resources.ResourceKey")
const $TagKey = Java.loadClass("net.minecraft.tags.TagKey")
const $EntityType = $ResourceKey.createRegistryKey("entity_type")
const IS_UNDEAD = $TagKey.create($EntityType, "minecraft:undead")
ServerEvents.tags("entity_type", event=>{
const zombies = [
"minecraft:drowned",
"minecraft:husk",
"minecraft:zoglin",
"minecraft:zombie",
"minecraft:zombie_horse",
"minecraft:zombie_villager",
"minecraft:zombified_piglin"
]
const undead = [
"#minecraft:skeletons",
"#minecraft:zombies",
"minecraft:phantom",
"minecraft:wither"
]
event.add("minecraft:zombies", zombies)
event.add("minecraft:undead", undead)
})
EntityEvents.death('irons_spellbooks:priest', event => {
let {source:{actual}, entity:{pos}, level} = event
if(!actual) return;
if(!actual.entityType.is(IS_UNDEAD)) return;
let necromancer = level.createEntity('irons_spellbooks:necromancer')
necromancer.setPos(pos)
necromancer.spawn()
})
Paste version of message.txt from @glossy saffron
did you use command /reload?
and you should send server.log
Please send your KubeJS server log. It can be found at /minecraft/logs/kubejs/server.log.
If you are on 1.18 or 1.16 it will be called server.txt.
Please send the file directly, without links or snippets.
yes I did
heres the server.log
Paste version of server.log from @glossy saffron
just tried that still no luck
Did the original code in the opening post work?
Paste version of server.log from @glossy saffron
alright. I assumed your code worked so I just did some modification to add the undead filter
no my bad I should have said something earlier
Unfortunately I am going to have a meeting and some other stuffs. I'd work on this when I get back serveral hours later.
ok
I am away from my computer, but I just found some old threads with createEntity. I think you can try .setPosition instead of .setPos
that worked
Glad to hear that. If everything's fine now, please remember to close the ticket